Methods for Filling Slots for Endometriosis-Related Symptoms in Multi-Round Consultation Dialogues
By constructing a heterogeneous causal graph of symptoms and optimizing the intent-aware query vector, the problems of dynamic adjustment of symptom information and consistency of slot filling in multi-round consultation dialogues were solved, and more accurate symptom slot filling results were achieved.
Patent Information
- Application Number
- CN202611376348.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-07
- Publication Date
- 2026-11-10
AI Technical Summary
Existing multi-round consultation dialogue slot filling methods fail to effectively utilize the dynamic adjustment and causal relationships of medical knowledge graphs, resulting in insufficient differentiated expression of symptom information among different patients, and the slot filling results lack medical logical consistency.
A heterogeneous causal graph of symptoms is constructed. Neighbors are divided by medical causal edge direction and differential pooling is performed. Combined with global dialogue intent vector and slot type embedding, an intent-aware query vector is generated. Joint loss is optimized by aligning the distribution of symptom causal chains.
It achieves dynamic adjustment of symptom slot filling and adaptive medical causality, improving the accuracy and consistency of slot filling and conforming to medical logical constraints.
Smart Images

Figure CN123068568A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and in particular to a method for filling symptom slots related to endometriosis in multi-turn consultation dialogues. Background Technology
[0002] Slot filling in multi-turn doctor-patient dialogues is an important task in the field of natural language processing. Its goal is to automatically extract key symptom information from doctor-patient interactions and fill it into predefined slots. In real-world clinical scenarios, patients' descriptions of symptoms are not completed all at once, but rather progress through stages as the doctor asks follow-up questions, exhibiting characteristics of initial mention, quantification of severity, time anchoring, and discovery of underlying causes. Complete information about the same symptom is often scattered across multiple discontinuous turns. This cross-turn information distribution pattern requires slot filling methods to not only understand single-turn semantics but also possess the ability to aggregate and track information evolution across turns.
[0003] In response, to achieve multi-round consultation dialogues, existing technologies and their shortcomings are reflected in the following aspects:
[0004] 1. Existing methods, when utilizing medical knowledge graphs, typically embed knowledge graph relationships directly as fixed features or static constraints. They fail to dynamically adjust the causal strength based on the actual temporal relationship of symptom occurrence and contextual semantics during individualized patient consultations. This results in the same pathological relationship failing to reflect differentiated importance in different patient conversations.
[0005] 2. Existing graph coding methods often use an indiscriminate message passing strategy when aggregating symptom node neighbor information. They do not distinguish between predecessor and successor neighbors according to the medical causal direction, nor do they dynamically control the fusion ratio of the two types of causal information according to the query requirements of different slots. This leads to mutual interference between etiological and result information, making it difficult to accurately support different types of slot filling tasks.
[0006] 3. Existing slot filling methods mostly use fixed slot type embedding for decoding, lacking the ability to perceive the global dialogue intent. Furthermore, they do not introduce medical causal consistency constraints between slots during the training process, which may lead to scattered and unrelated areas of interest when different slots are predicted independently, resulting in filling results with inconsistent medical logic.
[0007] Therefore, there is an urgent need for a method to fill the symptom slots related to endometriosis in multi-round consultations to solve the aforementioned technical problems. Summary of the Invention
[0008] Therefore, it is necessary to provide a method for filling symptom slots related to endometriosis in multi-round consultation dialogues to address the aforementioned technical issues.
[0009] This invention provides a method for filling symptom slots related to endometriosis in multi-round consultation dialogues, including:
[0010] S1. Obtain the original multi-round consultation dialogue and determine the predefined endometriosis symptom slots;
[0011] S2. Construct a symptom heterogeneous causal graph based on the original multi-round consultation dialogue; the symptom heterogeneous causal graph uses symptom mentions as nodes, and the nodes include at least co-occurrence edges and medical causal edges;
[0012] S3. Encode the symptom heterogeneous causal graph, divide the neighbors of each node into predecessor neighbors and successor neighbors according to the direction of the medical causal edge, and perform differential pooling processing on each, to generate a global dialogue intent vector and a slot-specific graph context representation.
[0013] S4. The slot-specific graph context representation is fused with the slot type embedding in the predefined endometriosis symptom slots and the global dialogue intent vector to generate an intent-aware query vector and predict the start and end positions of slot filling. Based on the start and end positions of all slots, the joint loss is optimized by fusing the symptom causal chain distribution alignment to obtain the trained slot filling model.
[0014] S5. Use the trained slot filling model to fill slots in the current multi-round consultation dialogue and output the filling results of each slot.
[0015] The beneficial effects of this invention are as follows:
[0016] 1. This invention constructs an adaptive symptom heterogeneous causal graph that integrates pathological causality and temporal consistency. By combining the static pathological pathways in the endometriosis knowledge graph with the virtual temporal sequence of the actual occurrence of symptoms in the current consultation, the weights of the medical causal edges can be dynamically adjusted according to the symptom evolution process of different patients, avoiding the fixed use of knowledge graph relationships.
[0017] 2. This invention constructs a direction-decoupled graph encoder, which divides medical causal neighbors into predecessor neighbors and successor neighbors according to edge direction, uses independent parameters for message aggregation, and dynamically adjusts the participation ratio of the two types of messages through causal direction gating coefficient, so that the etiology tracing slots and coexisting symptom slots can utilize causal information from different directions, avoiding the indiscriminate mixing of cause information and result information.
[0018] 3. This invention adopts an intent-aware dynamic slot decoding mechanism, which integrates slot type embedding, global dialogue intent vector and slot-specific graph context representation to generate query vector, and constrains the consistency of node attention distribution of slot pairs with pathological causal relationship through symptom causal chain distribution alignment regularization, so that slot filling conforms to medical logic constraints while maintaining independent positioning capability. Attached Figure Description
[0019] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0020] Figure 1 This is a flowchart of a method for filling symptom slots related to endometriosis in a multi-round consultation dialogue according to an embodiment of the present invention;
[0021] Figure 2 This is a flowchart illustrating the construction of a symptom heterogeneity causal graph according to an embodiment of the present invention;
[0022] Figure 3 This is a schematic diagram of an endometriosis knowledge graph according to an embodiment of the present invention;
[0023] Figure 4 This is a schematic diagram of the edge weight distribution between two sets of symptom pairs according to an embodiment of the present invention;
[0024] Figure 5 This is a schematic diagram illustrating the process of dividing predecessor neighbors and successor neighbors according to an embodiment of the present invention;
[0025] Figure 6 This is a schematic diagram illustrating the generation of the final node representation sequence and slot-specific graph context representation according to an embodiment of the present invention;
[0026] Figure 7 This is a schematic diagram of the probability distribution of the starting position and the probability distribution of the ending position of slot filling according to an embodiment of the present invention;
[0027] Figure 8 This is a bar chart comparing the F1 scores of slot filling for different slot types according to embodiments of the present invention. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0029] Please see Figure 1 It provides a method for filling symptom slots related to endometriosis in multi-round consultation dialogues, including:
[0030] Step S1: Obtain the original multi-round consultation dialogue and determine the predefined endometriosis symptom slots.
[0031] In the description of this invention, multiple rounds of consultation dialogues between doctors and patients are collected from endometriosis specialist clinics, remote consultation platforms, or simulated consultation environments, and the doctor's words, patient's words, the round to which the words belong, and the role of the words are saved according to the actual consultation order to form the original multi-round consultation dialogue.
[0032] Specifically, the first The original multi-round consultation dialogue was recorded as follows: , It refers to a dialogue sequence consisting of doctor's and patient's statements arranged in the actual consultation order; Indicates the sample index. ; This represents the total number of original multi-turn consultation dialogues. Each original multi-turn consultation dialogue includes at least a description of the patient's symptoms and follow-up questions from the doctor regarding at least one of the following: symptom severity, onset time, duration, location of pain, triggers, relief status, and coexisting symptoms.
[0033] For each original multi-turn consultation dialogue, predefined endometriosis symptom slots are labeled. These predefined endometriosis symptom slots include at least the severity of dysmenorrhea, the time of onset of dysmenorrhea, the duration of dysmenorrhea, the severity of chronic pelvic pain, the location of chronic pelvic pain, the severity of deep trigger pain, the trigger for deep trigger pain, the severity of defecation pain, the time of onset of defecation pain, abnormal menstrual flow, and coexisting symptoms. For slots with corresponding content in the original multi-turn consultation dialogue, the slot fill value is marked as falling within the text range of the original multi-turn consultation dialogue; for slots without corresponding content, the slot fill value is marked as empty.
[0034] After slot labeling is completed, the original multi-turn consultation dialogue and its corresponding slot labels are divided into training set, validation set, and test set. The training set is used to train the symptom heterogeneous causal graph encoding model and the intent-aware dynamic slot decoding model. The validation set is used to select model parameters. The test set is used to evaluate the slot localization accuracy, slot filling value accuracy, and the comprehensive recognition performance of different types of slots.
[0035] Step S2: Construct a heterogeneous causal graph of symptoms based on the original multi-round consultation dialogue; the heterogeneous causal graph of symptoms uses symptom mentions as nodes, and the nodes include at least co-occurrence edges and medical causal edges.
[0036] Specifically, during multiple rounds of consultations for endometriosis, the same symptom usually undergoes a progressive descriptive process, including initial mention (the smallest unit of symptom information processing), quantification of severity, time anchoring, discovery of triggers, and supplementation of relief. Furthermore, the periodic information of symptoms such as dysmenorrhea, chronic pelvic pain, deep triggered pain, and defecation pain may be scattered across multiple non-continuous rounds. If all rounds of consultations are directly spliced together, the evolutionary relationship of symptom description is easily interfered with by greetings, repetitive confirmations, and irrelevant medical history information, making it difficult to retain the key nodes in the transformation of symptoms from general description to specific description.
[0037] This invention first reconstructs the symptom evolution timeline based on symptom mentions and time expressions, filters out question-and-answer intent fragments containing symptom transfer points or key diagnostic follow-up questions, and then constructs a symptom heterogeneous causal graph by combining the pathological causal relationships in the endometriosis knowledge graph, so that subsequent slot filling can simultaneously utilize symptom progressive description information, local co-occurrence information, and medical causal information.
[0038] In the description of this invention, constructing a symptom heterogeneity causal graph based on the original multi-turn consultation dialogue includes:
[0039] Step S21: Identify symptom mentions, time expressions, and doctor's inquiry intent from the original multi-turn consultation dialogue, and filter question and answer intent fragments according to the doctor's inquiry intent to obtain a compressed structured dialogue sequence.
[0040] Specifically, this step takes the original multi-round consultation dialogue as input, identifies symptom mentions, time expressions, and doctor's inquiry intentions from the original multi-round consultation dialogue, and determines symptom transfer points based on the description changes of the same symptom in different rounds; then, adjacent rounds with continuous inquiry intentions and consistent symptom themes are merged into question-and-answer intention fragments, and only question-and-answer intention fragments containing symptom transfer points or key diagnostic follow-up questions are retained to obtain a compressed structured dialogue sequence.
[0041] In the description of this invention, symptom mentions, time expressions, and doctor's inquiry intent are identified from the original multi-turn consultation dialogue, and question-and-answer intent fragments are filtered according to the doctor's inquiry intent to obtain a compressed structured dialogue sequence, including:
[0042] Step S211: Divide the original multi-round consultation dialogue into multiple consultation rounds according to the original consultation order, and save the round index and discourse role for each utterance; use the endometriosis specialist dictionary to identify symptom mentions in each consultation round, and map the symptom expressions in the patient's natural language to the corresponding symptom concepts.
[0043] Specifically, the original multi-round consultation dialogue is divided into multiple consultation rounds according to the original consultation sequence. Each consultation round contains at least one doctor's statement or one patient's statement, and a round index and statement role are saved for each statement. The endometriosis specialist dictionary is used to identify symptom mentions in each consultation round, mapping the patient's symptom expressions in natural language to corresponding symptom concepts.
[0044] The endometriosis specialist dictionary includes at least the symptom concepts of dysmenorrhea, chronic pelvic pain, deep trigger pain, dysmenorrhea, abnormal menstrual flow, and infertility, as well as the standard names, synonyms, colloquial expressions, and common aliases for each symptom concept.
[0045] Furthermore, within each sentence mentioning a symptom and its adjacent text, regular expression templates and a medical dictionary are used to identify time expressions, severity modifier expressions, duration expressions, location expressions, trigger expressions, and relief expressions. Time expressions include phrases such as "within the last 2 months," "within the last 6 months," "day 1 of menstruation," and "starting 2 days before menstruation." Severity modifier expressions include phrases such as "mild," "obvious," "severe," and numerical ratings. Duration expressions include phrases such as "lasting for several hours," "lasting for 2 days," and "intermittently occurring." Location expressions include phrases such as "lower abdomen," "deep pelvic cavity," and "lumbosacral region." Trigger expressions include phrases such as "worsened after sexual activity," "occurring during defecation," and "worsened during menstruation." Relief expressions include phrases such as "relieved after taking painkillers" and "reduced after rest."
[0046] Furthermore, the identified attribute expressions are associated with and saved with the nearest and semantically matching symptom mentions to form attribute records for the corresponding symptom mentions. The attribute records are used to describe the degree, time, duration, location, trigger and relief status of the symptom mentions, and provide the original text position for subsequent reconstruction of the symptom evolution timeline and restoration of slot filling values.
[0047] Step S212: Convert the time expressions associated with each symptom into virtual time markers for comparison of their order of occurrence, and set the start time of the current original multi-round consultation dialogue as the origin of the virtual timeline.
[0048] Specifically, the time expressions associated with each symptom are converted into virtual time stamps that allow for comparison of chronological relationships, and the start time of the current original multi-round consultation dialogue is set as the origin of the virtual timeline. The virtual time stamps are used to uniformly describe the chronological order between relative time, periodic time, and fuzzy historical time; it is not required that all time expressions be converted to precise calendar dates.
[0049] It should be noted that when the time expression can only determine the time interval, the virtual time marker can be composed of the interval start point, interval end point and time granularity. When comparing the order of two symptom events, the time boundary that can be clearly compared should be used first. In the case of overlapping time intervals and the strict order cannot be determined, the two symptom events are marked as having an uncertain time order to avoid forcibly assigning an incorrect order relationship.
[0050] Step S213: Organize the symptom mentions in each consultation round according to the symptom concept and virtual time markers to form a symptom time event sequence, and arrange multiple symptom mentions of the same symptom concept in different consultation rounds according to the actual symptom occurrence time and consultation round order.
[0051] Specifically, symptom mentions in each consultation round are organized according to symptom concepts and virtual time markers to form a symptom time event sequence. For multiple symptom mentions of the same symptom concept in different consultation rounds, they are arranged according to their actual symptom occurrence time and consultation round order, and the severity, duration, nature of pain, location of pain, periodic location, triggers, and relief status are compared to see if there are any diagnostically significant changes.
[0052] In practical implementation, a subsequent relevant consultation round is marked as a symptom transfer point when it meets at least one of the following conditions relative to the previous relevant consultation round: ① The symptom severity changes from a lower level to a higher level; ② The symptom severity changes from a vague description such as "a little pain" to a specific quantitative description such as "pain score of 8 points"; ③ The symptom persistence changes from occasional to persistent, or the duration changes significantly; ④ The nature of the pain changes from dull pain to stabbing pain, cramping pain, dragging pain, or other different types of pain; ⑤ The symptom location changes from a general location such as "discomfort in the lower abdomen" to a specific anatomical location such as "deep pain in the left pelvis"; ⑥ A new temporal or precipitating relationship is established between the symptom and the menstrual cycle, sexual activity, or bowel movements; ⑦ The symptom relief method changes from unknown to specific relief by medication or rest. A symptom transfer point refers to a consultation round where the description of the same symptom changes from a general state to a more specific state, or where the symptom attribute undergoes a diagnostically significant change. By identifying symptom transfer points, consultation rounds that provide new diagnostic information can be distinguished from consultation rounds that simply repeat symptom names or reaffirm existing conclusions.
[0053] It should be noted that when determining the symptom transfer point, the previous relevant consultation round refers to the consultation round that is closest in time to the current symptom mention and is located before the current symptom mention, after arranging multiple symptom mentions belonging to the same symptom concept according to the consultation round order. In other words, the previous relevant consultation round is the consultation round that belongs to the same symptom concept as the current symptom mention and is immediately adjacent in the consultation sequence, rather than referring to the previous adjacent round or rounds of other symptom topics in general.
[0054] Step S214: Input each doctor's utterance and the corresponding patient's response into a lightweight dialogue behavior classifier to obtain the doctor's inquiry intent label for the current consultation round.
[0055] Specifically, each doctor's statement and its corresponding patient response are input into a lightweight dialogue behavior classifier to obtain the doctor's inquiry intent label for the current consultation round. The doctor's inquiry intent label includes at least the initial symptom inquiry, severity quantification, time anchoring, duration inquiry, location inquiry, trigger inquiry, relief status inquiry, key diagnostic follow-up questions, and other inquiries.
[0056] In one implementation, a lightweight dialogue behavior classifier is trained under supervision using endometriosis consultation statements labeled with doctor inquiry intent. The input to the lightweight dialogue behavior classifier is obtained by concatenating the current doctor's utterance and the patient's response following the doctor's utterance; the lightweight dialogue behavior classifier outputs the corresponding probability for each doctor inquiry intent label, and determines the doctor inquiry intent label with the highest probability as the doctor inquiry intent label for the current consultation round.
[0057] In this implementation, the lightweight dialogue behavior classifier adopts a text convolutional neural network structure, with the following specific configuration:
[0058] Input representation layer: The concatenated doctor's words and patient's response text are segmented into words, and each word is converted into a 300-dimensional word vector using word embeddings pre-trained in the endometriosis domain; the word embedding matrix remains fixed during classifier training;
[0059] Convolutional layers: Three types of convolutional kernels are used, with window sizes of 3, 4, and 5 respectively. There are 128 kernels of each size, with a stride of 1 for each kernel, and the activation function is the rectified linear function.
[0060] Pooling layer: Global max pooling is performed on the feature maps output by each size of convolution kernel to obtain three 128-dimensional feature vectors;
[0061] The concatenation and fully connected layer: The three 128-dimensional feature vectors are concatenated into a 384-dimensional vector, which is then input into a fully connected layer. The output dimension is equal to the number of categories of the doctor's inquiry intent label (9 categories in total: initial symptom inquiry, severity quantification, time anchoring, duration inquiry, location inquiry, trigger inquiry, relief status inquiry, key diagnostic follow-up questions, and other inquiries).
[0062] Output layer: The output of the fully connected layer is followed by a Softmax function, which outputs the probability of each intent label and takes the one with the highest probability as the predicted label.
[0063] During training, endometriosis consultation statements with manually labeled doctor inquiry intent (a total of 5000 doctor statements and their subsequent patient responses were collected) were used for supervised training. The loss function was cross-entropy loss, the optimizer was Adam, the initial learning rate was set to 0.001, the batch size was 64, and the training was conducted for 30 epochs. The model parameters with the highest accuracy on the validation set were retained.
[0064] It should be noted that key diagnostic follow-up questions refer to those that can directly supplement the differential diagnosis of endometriosis or provide key information in the symptom slots. Examples include inquiring whether symptoms are related to the menstrual cycle, whether there is deep triggered pain, whether there is pain during bowel movements, whether the pain affects daily activities, or whether there is a history of infertility. The lightweight dialogue behavior classifier is only used to identify the doctor's inquiry intent and determine whether adjacent consultation rounds belong to the same progressive consultation chain; it does not delete or modify the original consultation text.
[0065] Step S215: Check adjacent consultation rounds according to the consultation round order, and determine whether adjacent consultation rounds are similar based on the symptom concept and the doctor's inquiry intention label. Merge adjacent consultation rounds that revolve around the same symptom concept and whose doctor's inquiry intention belongs to the same progressive consultation chain into question and answer intention segments.
[0066] Specifically, adjacent consultation rounds are examined according to the consultation round sequence, and it is determined whether adjacent consultation rounds can be merged based on the symptom concept and the doctor's inquiry intent label. Specifically, when adjacent consultation rounds revolve around the same symptom concept and the doctor's inquiry intent belongs to the same progressive consultation chain, the adjacent consultation rounds are merged into the same question-and-answer intent segment.
[0067] Furthermore, when the primary symptom concept corresponding to an adjacent consultation round changes, or when the doctor's inquiry intent shifts to past medical history, medication history, or other disease information unrelated to the current symptom concept, the current question-and-answer intent segment ends, and a new question-and-answer intent segment is established starting from the current consultation round. When the doctor's utterance simultaneously inquires about multiple symptoms, the primary symptom theme is determined based on the symptom concepts actually involved in the patient's response; if a unique primary symptom theme cannot be determined, the connection between this consultation round and the question-and-answer intent segment with the strongest semantic correlation to its preceding and following segments is preserved.
[0068] In one implementation, when a doctor asks about multiple symptoms simultaneously, the primary symptom topic is determined based on the symptom concepts actually mentioned in the patient's response. Specifically, the symptom concepts corresponding to all symptom mentions identified in the patient's response are used as a candidate topic set. If the candidate topic set contains only one symptom concept, it is directly identified as the primary symptom topic. If it contains multiple symptom concepts, the symptom concept occupying the longest continuous text segment in the response or the symptom concept initially responded to by the doctor in subsequent follow-up questions is selected as the primary symptom topic. If a unique symptom topic cannot be determined, the connection between this consultation round and the question-and-answer intent segment with the strongest semantic association before and after it is preserved. When merging segments, this round is allowed to participate in the semantic association of two adjacent segments simultaneously, but it is not mandatory to classify it as a unique segment.
[0069] By merging question-and-answer intent fragments, the complete chain of follow-up questions for the same symptom, from its initial mention to the addition of attributes, can be preserved, while avoiding the mixing of different symptom topics and irrelevant medical history content into the same question-and-answer intent fragment.
[0070] Step S216: Examine each of the formed question-and-answer intent fragments, retain only those containing at least one symptom transfer point or at least one key diagnostic follow-up question, and splice the retained question-and-answer intent fragments according to the original consultation order to obtain a compressed structured dialogue sequence.
[0071] Specifically, examine each generated question-and-answer intent fragment, retain only those containing at least one symptom shift point or at least one key diagnostic follow-up question, and remove those containing only small talk, repetitive confirmation, or irrelevant medical history recollections.
[0072] The preserved question-and-answer intent fragments are then concatenated according to the original consultation order to obtain a compressed structured dialogue sequence, i.e. .in, The term "compressed structured dialogue sequence" refers to a dialogue sequence obtained by splicing together filtered question-and-answer intent fragments according to the original consultation order. Indicates the first A preserved fragment of question-and-answer intent. Internally, it includes consultation rounds with continuous inquiry intent and consistent symptom themes, and includes at least one symptom shift point or one key diagnostic follow-up question; Index of question-and-answer intent fragments; This indicates the total number of retained question-and-answer intent fragments. The duration of the original multi-round consultation dialogue and the complexity of the symptoms change dynamically. This indicates that the sequence is assembled according to the original consultation order.
[0073] In practical implementation, when a question-and-answer intent segment may involve multiple symptom concepts simultaneously, the method for independently determining the transfer point for each symptom concept is as follows: For each symptom concept appearing within the question-and-answer intent segment, the description changes of the symptom concept in each round of the current segment are compared according to conditions ① to ⑦ listed in step S213, and the round in which the transfer point of the symptom concept is located is independently marked; if a certain consultation round simultaneously meets the transfer point conditions of multiple symptom concepts, then that round will be marked as the transfer point of multiple symptoms simultaneously. During segment retention and screening, as long as a segment contains at least one transfer point of a symptom concept or at least one key diagnostic follow-up question, it is retained; the transfer points of multiple symptoms are recorded independently and do not affect the segment merging and screening logic.
[0074] It should be noted that compressing the structured dialogue sequence preserves the evolution of symptoms from initial mention to degree quantification, time anchoring, trigger discovery, and supplementation of relief conditions, which can reduce the interference of irrelevant consultation rounds on subsequent symptom standardization and slot filling.
[0075] Step S22: Standardize the symptom mentions in the compressed structured dialogue sequence into symptom concepts in the endometriosis knowledge graph, and use each standardized symptom mention as an independent node to calculate the medical causal edge weights and construct a symptom heterogeneous causal graph.
[0076] Specifically, such as Figure 2 As shown, this step takes a compressed structured dialogue sequence as input, standardizes the symptom mentions in the compressed structured dialogue sequence into symptom concepts in the endometriosis knowledge graph, and uses each standardized symptom mention as an independent symptom mention node; then, different types of connection edges are established based on local text co-occurrence relations and pathological causal pathways in the endometriosis knowledge graph, and the medical causal edge weights are calculated by combining pathological relation specificity, knowledge graph path distance, symptom occurrence order and contextual semantic similarity to obtain a symptom heterogeneous causal graph.
[0077] In the description of this invention, symptom mentions in compressed structured dialogue sequences are standardized into symptom concepts in an endometriosis knowledge graph. Each standardized symptom mention is used as an independent node, and medical causal edge weights are calculated to construct a symptom heterogeneous causal graph, including:
[0078] Step S221: Extract all symptom mentions from the compressed structured dialogue sequence, and map each symptom mention to a unique symptom concept in the endometriosis knowledge graph based on the standard names, synonyms and aliases mapping relationships in the endometriosis specialist dictionary.
[0079] Specifically, from compressed structured dialogue sequences All symptom mentions were extracted, and each symptom mention was mapped to a unique symptom concept in the endometriosis knowledge graph based on the standard names, synonyms, and aliases in the endometriosis specialist dictionary.
[0080] In the specific implementation, the symptom mention text is first matched precisely or approximately with an endometriosis specialist dictionary. When the same symptom mention may correspond to multiple symptom concepts, the degree expression, location expression, time expression, trigger expression, and adjacent symptom mentions in the question-and-answer intent segment where the symptom mention is located are read, and the semantic matching degree between the current symptom mention context and the descriptions of each candidate symptom concept is calculated. The candidate symptom concept with the highest semantic matching degree is determined as the standardized result.
[0081] One implementation employs a two-stage strategy: precise matching followed by approximate matching. Specifically, precise matching performs a full string comparison between the symptom mention text and the standard names, synonyms, and common aliases in the endometriosis specialist dictionary. If a match is found, the unique mapped symptom concept is returned directly. If precise matching fails, approximate matching uses fuzzy matching based on character-level edit distance. It calculates the edit distance between the symptom mention text and all entries in the dictionary. If the minimum edit distance is less than a preset threshold, the symptom concept mapped to the corresponding entry is considered a candidate. If multiple candidates with the same distance exist, the semantic disambiguation step is initiated. Furthermore, semantic disambiguation (triggered when multiple candidates are generated by precise or approximate matching) reads the degree expression, location expression, time expression, causal expression, and adjacent symptom mentions from the question-and-answer intent fragment containing the symptom mention, calculating the semantic matching degree between the current symptom mention's context and the descriptive text of each candidate symptom concept in the endometriosis knowledge graph.
[0082] In this implementation, when calculating the semantic matching degree, the sentence vectors of the sentence containing the symptom mention and the candidate concept description text are first extracted using Medical BERT (Biomedical Pre-trained Language Model). Then, the cosine similarity between the two vectors is calculated. Semantic matching degree = cosine similarity (sentence vector of symptom mention context, sentence vector of candidate concept description). Finally, the candidate symptom concept with the highest semantic matching degree is selected as the standardized result.
[0083] It should be noted that the symptom standardization process preserves the original text position, consultation round, question-and-answer intent segment, virtual timestamp, and associated attribute records for each symptom mention in the compressed structured dialogue sequence. Multiple symptom mentions of the same symptom concept in different consultation rounds are established as different symptom mention nodes (referred to as nodes), enabling the symptom heterogeneous causal graph to preserve the description changes of the same symptom in different times and consultation contexts.
[0084] In one embodiment, an example of displaying an endometriosis knowledge graph is as follows: Figure 3 As shown in the figure, each node represents various core symptoms, related symptoms, and pathological mechanisms, such as neurosensitization, chronic pelvic pain, dysmenorrhea, etc.; solid lines between nodes indicate a relationship of cause or aggravation between the two, while dashed lines indicate a comorbid relationship.
[0085] Step S222: Generate an independent node for each symptom mention and generate initial node features for each node; the initial node features are obtained by concatenating the context semantic vector with the structural embedding vector of the corresponding symptom concept in the endometriosis knowledge graph.
[0086] Specifically, first, the sentence containing the symptom mention and its adjacent context are input into the Medical BERT, and the context encoding result of the text position corresponding to the symptom mention is read to obtain the context semantic vector; then, the TransR structure embedding vector of the symptom concept corresponding to the symptom mention in the endometriosis knowledge graph is read; finally, the context semantic vector and the TransR structure embedding vector are concatenated along the feature dimension to obtain the initial features of the symptom mention node, i.e. .
[0087] in, Indicates symptom mention nodes The symptoms mention the initial features of the nodes, with dimensions of , It equals the sum of the dimension of the context semantic vector and the dimension of the TransR structure embedding vector; Indicates the node identifier mentioned in the symptom list; Indicates symptom mention nodes The contextual semantic vector is used to represent the degree, timing, location, triggering factors, and relief information of the current symptom mention in the consultation context; Indicates symptom mention nodes The TransR structural embedding vector of the corresponding symptom concept is used to represent the structural position and relational attributes of the corresponding symptom concept in the endometriosis knowledge graph; This indicates a vector concatenation operation.
[0088] In one implementation, the dimensions of the context semantic vector and the TransR structure embedding vector can be adjusted separately through linear mapping to make the concatenated vector... The optimal value is 256. By simultaneously preserving contextual semantic information and knowledge graph structural information, it is possible to distinguish multiple symptom mention nodes with the same symptom name but different degrees, times, or causes.
[0089] In this implementation, linear mapping adjustment is achieved through two independent linear transformation layers, which respectively transform the context semantic vector. and TransR structure embedding vector Mapping to 128 dimensions, and then concatenating the two mapped 128-dimensional vectors, yields the dimension. The initial features of the node mentioned for symptoms of 256 .
[0090] It should be noted that Medical BERT (Biomedical Bidirectional Encoder Representations from Transformers) refers to a language representation model pre-trained on large-scale biomedical text corpora. In one implementation, BioBERT is preferred. This model is publicly available, and pre-trained weights can be downloaded from model libraries such as HuggingFace (e.g., "dmis-lab / biobert-base-cased-v1.1"). The model employs a multi-layer Transformer encoder structure, containing 12 Transformer layers with a hidden layer dimension of 768 and 12 self-attention heads. Its input is a segmented text sequence (the sentence containing the symptom mention and its adjacent context). The last layer of the model outputs a context-related vector representation for each input word. The word vector at the corresponding text position of the symptom mention, or its average, is taken as the context semantic vector. Global dialogue intent vector Then take the output vector corresponding to the special classification label [CLS] at the beginning of the input sequence.
[0091] It should also be noted that TransR structural embedding vectors are a vectorization method used to represent entities and relations in knowledge graphs. It is a common technique in knowledge graph embedding technology, and its core idea is to project entities and relations into different vector spaces to better model the complex relationships between entities. In this invention, for each symptom concept (entity) in the endometriosis knowledge graph, the TransR model is pre-trained on the knowledge graph to learn a structural embedding vector for each symptom concept. , The vector encodes the location of the symptom concept within the global topology of the knowledge graph, as well as its multidimensional relationship attributes with other entities. This process is performed offline; that is, the vector is generated and stored before the endometriosis symptom slot-filling model is trained, and is directly read and used during model training.
[0092] It should also be noted that the contextual semantic vector used to calculate the cosine similarity in this step is the initial feature used to generate the symptom mention node after the dimensions have been adjusted by the linear mapping layer. A 128-dimensional vector.
[0093] Step S223: Using all standardized symptom mentions as nodes, establish a node set; establish an undirected co-occurrence edge for any two nodes in the compressed structured dialogue sequence whose text distance is lower than a preset distance threshold, and form a co-occurrence edge set from all undirected co-occurrence edges.
[0094] Specifically, a set of symptom mention nodes is established using all standardized symptom mentions as symptom mention nodes. For any two symptom mention nodes in a compressed structured dialogue sequence whose text distance is no more than 3 sentences, establish undirected co-occurrence edges and form a co-occurrence edge set from all undirected co-occurrence edges. .
[0095] Text distance refers to the number of sentences between two symptom mentions. Two symptom mentions are considered to have a co-occurrence relationship in the local consultation context when they are in the same sentence, adjacent sentences, or no more than three sentences apart.
[0096] It should be noted that co-occurrence edges are used to characterize the co-occurrence relationship of symptom mentions in the local consultation context. Each co-occurrence edge uses a uniform preset fixed weight, such as 0.5, to enable local semantic co-occurrence information to participate in subsequent graph message passing. At the same time, it avoids the co-occurrence edge weight having the same meaning as the adaptive weight of medical causal edges. This weight is only used to provide a baseline and uniform association strength in subsequent graph neural network message passing, avoiding confusion with the adaptive medical causal edge weight with medical semantics.
[0097] Step S224: For any two nodes in the node set, when there is a pathological causal path between the two corresponding symptom concepts in the endometriosis knowledge graph, establish candidate medical causal edges according to the causal direction, and form a medical causal edge set by combining all candidate medical causal edges.
[0098] Specifically, for the set of symptom mention nodes For any two symptom mention nodes, retrieve the relationship between their corresponding symptom concepts in the endometriosis knowledge graph. Specifically, when there is a direct or indirect pathological causal pathway between two symptom concepts (causing, aggravating, accompanying, or otherwise predefined), establish candidate medical causal edges according to the causal direction in the endometriosis knowledge graph, and combine all candidate medical causal edges into a medical causal edge set. .
[0099] In this context, the direction of the candidate medical causal edges points from the cause symptom mention node to the result symptom mention node. For multiple symptom mentions of the same pair of symptom concepts in the compressed structured dialogue sequence, candidate medical causal edges are established based on the virtual timestamps corresponding to each symptom mention, rather than merging multiple mentions of the same symptom concept into a single node, thus preserving the actual symptom evolution order in this consultation.
[0100] In practical implementation, when multiple causal pathways exist between two symptom concepts, the causal pathway with the fewest hops is selected as the shortest causal path. When multiple shortest causal paths have the same number of hops, the causal path with higher relationship specificity is selected. The shortest causal path is used to determine the dominant relationship type and the number of hops in medical causal edges.
[0101] Step S225: Determine static medical knowledge items based on the pathological relationship characteristics and path distance between the two symptom concepts corresponding to each candidate medical causal edge; determine dynamic temporal semantic items based on the order of virtual time stamps and contextual semantic similarity of the two nodes corresponding to the candidate medical causal edge; input the static medical knowledge items and dynamic temporal semantic items into the activation function to obtain the medical causal edge weight of the candidate medical causal edge, and form an edge weight set with the preset co-occurrence edge weights.
[0102] Specifically, regarding the points mentioned in the symptoms Pointing to symptom mention nodes The candidate medical causal edges are analyzed, and the shortest causal path, dominant relationship type, and shortest path hop count between two symptom concepts are read. Then, the symptom mention nodes are compared. and symptom mention nodes The virtual timestamps are used, and the cosine similarity is calculated based on the contextual semantic vectors of the two symptom mention nodes.
[0103] Furthermore, by inputting both static medical knowledge terms and dynamic temporal semantic terms into the Sigmoid activation function, the medical causal edge weights are obtained, expressed as:
[0104] ;
[0105] in, Indicates the node mentioned in the symptoms Pointing to symptom mention nodes The medical causal edge weight; the larger the value, the more consistent the corresponding pathological causal relationship is with the symptom evolution process in the current consultation; symbol Indicates a temporal priority relationship, with the semantic meaning of "earlier than"; This represents the Sigmoid activation function, used to restrict the weights of medical causal edges to [a specific value]. Within the range;
[0106] This represents the static medical knowledge contribution adjustment parameter, used to control the influence of pathological relationship specificity and knowledge graph path distance on the weight of medical causal edges. An example value is 0.7. This represents the dynamic temporal semantic contribution adjustment parameter, used to control the influence of the symptom occurrence order and contextual semantic similarity on the weights of medical causal edges. An example value is 0.3.
[0107] Indicates the dominant relation type Corresponding relationship-specific factors are used to distinguish the importance of different medical causal relationships; Indicates symptom mention nodes Corresponding symptom concept to symptom mention node The dominant relation type in the shortest causal path corresponding to the symptom concept; in one implementation, the relation specificity factor corresponding to the direct cause relation can be 3.0, the relation specificity factor corresponding to the accompanying relation can be 1.0, and the relation specificity factors of other relation types are pre-set according to the medical relation level in the endometriosis knowledge graph;
[0108] Indicates symptom mention nodes and symptom mention nodes The shortest path hop count for corresponding symptom concepts in the endometriosis knowledge graph; the smaller the shortest path hop count, the more direct the pathological connection between the two symptom concepts; through analysis of... Take the natural logarithm so that the static medical knowledge item gradually decreases as the path distance increases, while avoiding the contribution of long-range causal pathways being directly set to 0;
[0109] Indicates symptom mention nodes Virtual time markers corresponding to symptom events; Indicates symptom mention nodes Virtual time markers corresponding to symptom events; This indicates a timing indicator function, which is invoked when a symptom is mentioned. The corresponding symptom event occurred before the symptom mention point. The value is 1 when corresponding to a symptom event, and 0 otherwise. For cases where the time sequence cannot be determined, the time sequence indicator function is 0, so that the weight of the corresponding candidate medical causal edge is determined only based on static medical knowledge items.
[0110] Symptom mention nodes and symptom mention nodes The cosine similarity between the context semantic vectors is used to characterize the degree of semantic association between the two symptom mentions in the current consultation context. When the actual occurrence order of the two symptom mentions is consistent with the direction of medical causality and the context semantic association between the two symptom mentions is strong, the corresponding medical causal edge obtains a high dynamic temporal semantic gain.
[0111] It should be noted that, The item is a static medical knowledge item, used to quantify the strength and directness of the causal relationship between two symptom concepts from a massive, fixed medical knowledge base (endometriosis knowledge graph). Its value is entirely determined by the topological structure of the knowledge graph and the predefined medical relationship level, and is unrelated to the current specific dialogue. The term is a dynamic temporal semantic term used to dynamically capture the temporal relationship between two symptoms and their semantic relevance within the context of the current patient's specific consultation dialogue. The static term provides a universally applicable medical prior, while the dynamic term modifies and confirms this prior based on the specific circumstances of each individual case. The final causal edge weight is only determined when the two symptoms are medically related (large static term value), and when their actual occurrence order in the current consultation aligns with the causal direction and the contextual semantics are also relevant (large dynamic term value). This will significantly enhance the symptom causal model, thereby enabling personalized, high-confidence symptom causal modeling.
[0112] In one computational example, as an illustration, a candidate medical causal edge corresponds to a direct causal relationship, the relationship specificity factor is set to 3.0, and the shortest path hop count is 1. The order of occurrence of the two symptom events is consistent with the direction of medical causality, the temporal indicator function is set to 1, and the contextual semantic cosine similarity is 0.8. Substituting the corresponding values into the medical causal edge weight calculation process yields the adaptive weight of the candidate medical causal edge. Compared to setting fixed weights solely based on the existence of paths in the knowledge graph, this calculation method can further distinguish symptom relationships in the current consultation that are consistent in time sequence and have clear contextual connections.
[0113] Step S226: Combine the node set, co-occurrence edge set, medical causal edge set, and corresponding edge weight set to obtain the initial symptom heterogeneous causal graph.
[0114] Specifically, by combining the set of symptom mention nodes, the set of co-occurrence edges, the set of medical causal edges, and the set of edge weights, an initial heterogeneous causal graph of symptoms is obtained, i.e. .
[0115] in, A heterogeneous causal diagram representing initial symptoms; This represents the set of nodes mentioned by symptoms, and the total number of nodes mentioned by symptoms is denoted as . ; Denote the set of co-occurring edges; Represents the medical causal edge set; This represents the set of edge weights, which includes the preset fixed weights of co-occurring edges and the adaptive weights of medical causal edges.
[0116] It should be noted that the co-occurrence edges in the initial symptom heterogeneous causal graph have no direction and are used to convey symptom co-occurrence information in the local consultation context; the medical causal edges have direction and are used to convey pathological causal information between symptom concepts and symptom evolution information in the current consultation.
[0117] Step S227: For each node, retain the maximum number of neighbor connections according to the corresponding edge weights from largest to smallest to obtain the final symptom heterogeneous causal graph.
[0118] Specifically, for each symptom mention node, the co-occurrence edges and medical causal edges connected to the current symptom mention node are summarized, and sorted in descending order of their respective edge weights, retaining only the top-weighted edges. The neighbor connections are used to obtain the final symptom heterogeneous causal graph. Among them, This represents the maximum number of neighbors that each symptom mention node is allowed to retain. It is used to control the sparsity of the final symptom heterogeneous causal graph and the computational cost of subsequent graph encoding. An example value is 10.
[0119] In practical implementation, when the number of neighbor connections of a node mentioned by a certain symptom does not exceed When the symptom is mentioned, retain all neighbor connections of the node; when the number of neighbor connections exceeds... When, retain the edge with the larger weight. There are several neighbor connections. For medical causal edges, the edge direction information is stored according to the incoming and outgoing edges, so that the subsequent direction decoupling graph encoder can distinguish between predecessor neighbors and successor neighbors.
[0120] It should be noted that by using edge weight sorting and neighbor pruning, neighbor connections with clear pathological relationships, consistent temporal order, or strong local semantic associations can be prioritized for retention, reducing the interference of weakly associated symptom mentions and redundant co-occurrence relationships on subsequent causal message transmission.
[0121] It should be noted that this step uses the static causal pathways in the medical knowledge graph and the actual symptom occurrence order in the current consultation together for the calculation of medical causal edge weights. This allows the same knowledge graph relationship to obtain different weights according to the symptom evolution process of different patients, thereby improving the adaptability of the symptom heterogeneous causal graph to individualized consultation content.
[0122] In one embodiment, the distribution of medical causal edge weights on symptom pairs with different pathological relationships is compared to verify whether the adaptive weight calculation method for medical causal edges proposed in this invention can effectively distinguish between symptom pairs with direct pathological causal relationships and ordinary symptom pairs without direct causal relationships in the medical knowledge graph. Figure 4As shown in the figure, a violin plot illustrates the distribution of edge weights between two sets of symptom pairs. The blue violins on the right represent symptom pairs without a direct pathological causal relationship, while the red violins on the left represent symptom pairs with a direct pathological causal relationship. The vertical axis represents the numerical value of the medical causal edge weights, ranging from 0 to 1. A larger value indicates a stronger causal association recognized by the model in the current consultation context. The width of the violin plot reflects the probability density of the data points, the inner box marks the median and interquartile range, the outer black horizontal line indicates the mean, and the scatter plot represents the distribution of actual sample values. Experimental results show that the adaptive edge weight calculation method can assign significantly higher edge weights to symptom pairs with a direct pathological causal relationship than to symptom pairs without a direct causal relationship.
[0123] Step S3: Encode the symptom heterogeneous causal graph, divide the neighbors of each node into predecessor neighbors and successor neighbors according to the direction of the medical causal edge, and perform differential pooling processing on each, to generate a global dialogue intent vector and a slot-specific graph context representation.
[0124] Specifically, there is a pathological causal chain between endometriosis symptoms, which extends from the causal symptoms or central symptoms to the secondary symptoms. Different slots need to utilize different causal directions. Etiological slots need to focus on extracting the precursor information pointing to the current symptom, while coexisting symptom slots need to focus on extracting the secondary information extending outward from the current symptom. If the precursor and secondary neighbors are aggregated indiscriminately, the causal symptom information and the result symptom information are easily confused with each other.
[0125] like Figure 5 As shown, this invention divides medical causal neighbors into predecessor neighbors and successor neighbors according to the direction of the medical causal edge, performs relationship-specific and direction-specific message aggregation respectively, and dynamically controls the participation ratio of the two types of messages through the causal direction gating coefficient.
[0126] In the description of this invention, the symptom heterogeneous causal graph is encoded, and the neighbors of each node are divided into predecessor neighbors and successor neighbors according to the direction of the medical causal edge. Differential pooling processing is then performed on each neighbor to generate a global dialogue intent vector and a slot-specific graph context representation, including:
[0127] Step S31: In the encoding process of the heterogeneous causal graph of symptoms at each layer, calculate the predecessor neighbor aggregation message and the successor neighbor aggregation message respectively, and generate the causal direction gating coefficient according to the current node state and global dialogue intent, and update the node features mentioned by the symptoms through the gating loop unit.
[0128] Specifically, this step takes the final heterogeneous causal graph of symptoms and the initial features of the symptom mention nodes as input. In the graph encoding process of each layer, the predecessor neighbor aggregation message and the successor neighbor aggregation message are calculated respectively. Then, the causal direction gating coefficient is generated according to the current state of the symptom mention node and the global dialogue intent. Finally, the features of the symptom mention node are updated through the gating loop unit.
[0129] In the description of this invention, during the encoding process of each layer of the symptom heterogeneous causal graph, the preceding neighbor aggregation message and the subsequent neighbor aggregation message are calculated respectively, and causal direction gating coefficients are generated based on the current node state and global dialogue intent. The node features mentioned in the symptoms are updated through the gating loop unit, including:
[0130] Step S311: For any target node, the nodes that point to the target node through the medical causal incoming edge are classified as medical predecessor neighbors, and the medical predecessor neighbors are formed into a medical predecessor neighbor set; the nodes that the target node points to through the medical causal outgoing edge are classified as medical secondary neighbors, and the medical secondary neighbors are formed into a medical secondary neighbor set; the nodes that are connected to the target node through the co-occurrence edge are formed into a co-occurrence neighbor set.
[0131] Specifically, for any symptom mention node in the final symptom heterogeneous causal graph... (Referring to the target node), which will point to the symptom mention node through medical causal incoming edges. Symptom mention nodes are categorized into medical precursor neighbors, and these medical precursor neighbors are grouped into a medical precursor neighbor set. Medical precursor neighbors represent symptom mentions that, given the endometriosis knowledge graph and the current consultation time sequence, may lead to, aggravate, or precede the current symptom.
[0132] At the same time, the nodes mentioned by symptoms will be The symptom mention nodes pointed to by medical causal outgoing edges are classified as medical secondary neighbors, and these medical secondary neighbors are grouped into a medical secondary neighbor set. Medical secondary neighbors represent symptom mentions that may be caused by the current symptom, accompany the current symptom, or develop after the current symptom.
[0133] Furthermore, this will be achieved through co-occurrence edges and symptom mention nodes. The connected symptom-related nodes form a set of co-occurring neighbors. Since co-occurring edges do not have a medical causal direction, co-occurring neighbors participate in both the preceding and succeeding direction message aggregation, but use the independent relation parameters (referring to the preceding direction transformation matrix described later) for each direction. and secondary direction transformation matrix Co-occurring neighbors are only used to supplement local diagnostic semantics and are not used to determine whether the corresponding symptom is a causal symptom or a result symptom.
[0134] Furthermore, the medical precursor neighbor set and the co-occurrence neighbor set are merged to obtain the precursor aggregated neighbor set; the medical secondary neighbor set and the co-occurrence neighbor set are merged to obtain the secondary aggregated neighbor set. Through this partitioning, the directional information of the medical causal edges is explicitly preserved during the graph encoding process.
[0135] Step S312: For each neighbor node in the predecessor aggregated neighbor set, select the corresponding predecessor direction transformation matrix according to the edge relationship type to project the features of the neighbor node, calculate the predecessor attention weight through the attention mechanism, and perform weighted summation of the projected features of all predecessor neighbors to obtain the predecessor neighbor aggregated message.
[0136] Specifically, for each neighbor symptom mention node in the predecessor aggregated neighbor set. (Referring to neighbor nodes), nodes mentioned based on symptoms Related to symptom mention nodes Select the corresponding predecessor direction transformation matrix for the edge relationship type and mention the symptom node. The node features of the previous layer are projected onto the predecessor semantic subspace. Among them, medical causal edges select corresponding relation parameters according to the relation type such as causing, aggravating, or accompanying, and co-occurrence edges use the predecessor direction parameters corresponding to the co-occurrence relation.
[0137] Specifically, for the first Layer diagram encoding, relation type The corresponding forward direction transformation matrix is denoted as: , Used to classify relation types The characteristics of neighboring nodes are converted into predecessor direction messages; This represents the index of the directional decoupling graph coding layer. ; Indicates the relationship type of the current connecting edge; This indicates the total number of layers in the directional decoupling graph encoder.
[0138] In practical implementation, the central symptom will be mentioned in the node. Previous layer features, neighboring symptom mention nodes Features and relation types after precursor direction transformation The corresponding relation embedding and the current connection edge weight are concatenated, and then input into the additive attention scoring function to obtain the neighbor symptom mention node. Relative to the central symptom mention node The predecessor attention score. Softmax normalization is performed on all predecessor attention scores within the predecessor aggregated neighbor set, so that the sum of all predecessor attention weights is 1.
[0139] Furthermore, the features of each neighboring symptom mention node after the predecessor direction transformation are multiplied by the corresponding predecessor attention weight, and the weighted features of all the neighboring features in the predecessor aggregation set are summed to obtain the symptom mention node. In the Layer's predecessor neighbor aggregation message Forefront Neighbor Aggregation Messages This is used to characterize possible causal symptom information and supplementary semantic information that is locally co-occurring with the current symptom.
[0140] In practical implementation, the predecessor neighbor aggregates messages. The specific calculation process is expressed as follows:
[0141] ;
[0142] ;
[0143] ;
[0144] in, Indicates the central symptom mention node Its neighboring nodes in the predecessor aggregated neighbor set The preceding attention score (scalar) between nodes is unnormalized; a larger score indicates higher neighboring nodes in the graph encoding of the current preceding direction. For the central node The more important the impact; Indicates the first In layered graph encoding, the trainable weight vector used to calculate the predecessor attention score has the same dimension as the output dimension of the hyperbolic tangent function, mapping the result of the hyperbolic tangent function activation to a scalar score. Indicates the first In layered graph encoding, it is used for the central node. Previous layer features Trainable weight matrix for linear transformation; Indicates the first In layer graph encoding, it is used to identify neighboring nodes. After relation type Corresponding features after the change in the direction of the precursor Trainable weight matrix for linear transformation; Indicates the first In layer graph encoding, it is used for relation embedding. Trainable weight matrix for linear transformation; Indicates the central node with neighboring nodes The relation embedding vector corresponding to the relation type of the connecting edges is a low-dimensional, dense vector representation used to encode the semantic information of the relation type (such as causing, accompanying, or co-occurring). Indicates the first In layered graph encoding, a trainable bias vector is used to calculate the predecessor attention score; Indicates the central node Neighbor nodes in its predecessor aggregated neighbor set The predecessor attention weight (scalar), this weight is based on In all the predecessor neighbors The result after Softmax normalization, all predecessor neighbors The sum is 1; Indicates the central symptom mention node The predecessor aggregate neighbor set, which consists of nodes It is formed by merging the medical precursor neighbor set and the co-occurrence neighbor set; This indicates that when calculating Softmax normalization, the set... A traversal index for all neighboring nodes; Indicates the central node With sets any neighboring node in The preceding attention score (scalar) between them.
[0145] It should be noted that the larger the weight of the medical causal edge, the higher the attention contribution of the corresponding medical predecessor neighbor, which makes the cause and symptom information with clear pathological relationship and consistent time sequence participate in the update of the current symptom mention node first.
[0146] Step S313: For each neighbor node in the secondary aggregated neighbor set, perform relation type selection, neighbor node feature projection, central node and neighbor node relation fusion, edge weight fusion and attention normalization using the secondary direction independent parameters in the same processing order as the predecessor direction message aggregation, to obtain the secondary neighbor aggregated message of the target node in the current layer.
[0147] Specifically, for each neighbor symptom mention node in the secondary aggregated neighbor set. Following the same processing order as the predecessor direction message aggregation, the relationship type selection, neighbor node feature projection, center node and neighbor node relationship fusion, edge weight fusion, and attention normalization are performed using independent parameters of the successor direction to obtain the symptom mention node. In the Layered secondary neighbor aggregation messages .
[0148] Specifically, relation types The corresponding secondary direction transformation matrix is denoted as , Used to classify relation types The features of neighboring nodes are converted into successor direction messages. Predecessor direction transformation matrix. and secondary direction transformation matrix Using mutually independent trainable parameters, cause symptom information and result symptom information are projected into different semantic subspaces.
[0149] It should be noted that secondary neighbor aggregation messages This is used to characterize potential outcome symptom information and supplementary semantic information that locally co-occurs with the current symptom. By generating predecessor neighbor aggregation messages and successor neighbor aggregation messages separately, the indiscriminate mixing of causal information pointing to the current symptom with outcome information extending outward from the current symptom can be avoided.
[0150] In practical implementation, follow-up neighbor aggregation messages The specific calculation process is expressed as follows:
[0151] ;
[0152] ;
[0153] ;
[0154] in, Indicates the central symptom mention node Its neighbor nodes in the secondary aggregated neighbor set The secondary attention score (scalar) between nodes is unnormalized; a larger score indicates higher attention from neighboring nodes in the graph encoding of the current secondary direction. For the central node The more important the impact; Indicates the first In layer graph encoding, the trainable weight vector used to calculate the secondary attention score has the same dimension as the output dimension of the hyperbolic tangent function, mapping the result of the hyperbolic tangent function activation to a scalar score. Indicates the first In layered graph encoding, it is used for the central node. Previous layer features Trainable weight matrix for linear transformation; Indicates the first In layer graph encoding, it is used to identify neighboring nodes. After relation type Corresponding features after secondary direction transformation Trainable weight matrix for linear transformation; Indicates the first In layer graph encoding, it is used for relation embedding. Trainable weight matrix for linear transformation; Indicates the first In layered graph encoding, a trainable bias vector is used to compute the secondary attention score; Indicates the central node Neighbor nodes in its secondary aggregated neighbor set The secondary attention weight (scalar). This weight is based on... In all secondary neighbors The result after Softmax normalization, all secondary neighbors The sum is 1; Indicates the central symptom mention node The secondary aggregated neighbor set, which consists of nodes It is formed by merging the medical secondary neighbor set and the co-occurrence neighbor set; This indicates that when calculating Softmax normalization, the set... A traversal index for all neighboring nodes; Indicates the central node With sets any neighboring node in Secondary attention scores (scalars) between them.
[0155] Step S314: Input the compressed structured dialogue sequence into the biomedical pre-trained language model, read the output vector corresponding to the classification label of the biomedical pre-trained language model, and obtain the global dialogue intent vector.
[0156] Specifically, the structured dialogue sequence will be compressed. Input the Medical BERT (Biomedical Pre-trained Language Model) and read the output vector corresponding to the Medical BERT classification label to obtain the global dialogue intent vector. Global dialogue intent vector This dimension is used to characterize whether the current consultation focuses more on tracing the cause of the disease, confirming the severity of symptoms, confirming the time pattern of symptoms, confirming the triggers of symptoms, or discovering coexisting symptoms. .
[0157] Furthermore, for the first Layered graph coding, mentioning symptom nodes Node features in the previous layer With global dialogue intent vector The components are concatenated along the feature dimension, and then causal direction gating coefficients are generated through linear mapping and the Sigmoid activation function, as follows:
[0158] ;
[0159] in, Indicates symptom mention nodes In the The causal direction gating coefficient of the layer, with a value range of 1. ; Indicates symptom mention nodes In the Layer node features, dimension 1 ; Indicates the first The trainable weight vector in the generation process of the layer causal direction gating coefficients, with dimension [missing information]. ; Indicates the first Trainable bias scalar in the generation process of layer causal orientation gating coefficients; This represents the Sigmoid activation function.
[0160] It should be noted that the causal direction gating coefficient The closer the coefficient is to 1, the more emphasis is placed on the aggregation of predecessor neighbor messages when the current symptom mentions node updates; causal direction gating coefficient The closer the value is to 0, the more emphasis is placed on subsequent neighbor aggregation messages when updating the current symptom mentioning node. Since the causal direction gating coefficient is determined by both the current symptom mentioning node state and the global dialogue intent, the same symptom mentioning node can use different proportions of causal direction information in different consultation contexts.
[0161] Step S315: Based on the causal direction gating coefficient, perform weighted fusion of the predecessor neighbor aggregation message and the successor neighbor aggregation message to obtain the causal neighborhood input message of the target node in the current layer, and input the causal neighborhood input message into the gating loop unit to update the current node features.
[0162] Specifically, based on the causal direction gating coefficient, the aggregated messages of predecessor neighbors and the aggregated messages of successor neighbors are weighted and fused to obtain the symptom mention nodes. In the The causal neighborhood input message of the layer is represented as:
[0163] ;
[0164] in, Indicates symptom mention nodes In the The causal neighborhood input message of the layer has a dimension of ; Indicates symptom mention nodes In the The previous neighbor aggregation message of the layer; Indicates symptom mention nodes In the Secondary neighbor aggregation messages of the layer.
[0165] In practical implementation, the causal direction gating coefficient As a scalar, in relation to Forward Neighbor Aggregation Messages and When performing computation on the neighbor aggregation message, it broadcasts along the feature dimension. Through scalar gating, the participation ratio of the two types of causal direction messages can be uniformly adjusted without changing the node feature dimension.
[0166] Furthermore, the causal neighborhood input message As the current input to the gated loop unit, the symptom mention node is used. Node features in the previous layer As the historical hidden state of the gated loop unit, the symptom mention node is obtained. In the The updated node features of a layer are represented as follows:
[0167] ;
[0168] in, Symptom mention nodes In the The layer updates node features, with dimensions of ; This is a gated loop unit. The first input is the current input, and the second input is the historical hidden state.
[0169] In the specific implementation, the gated loop unit updates the proportion of causal neighborhood input messages written to the current symptom mention node by updating the gate, and resets the influence of historical node features on the candidate state by resetting the gate, so that the symptom mention node can absorb relevant cause symptom or result symptom information, while retaining the original degree, time, location and trigger semantics of the current symptom mention.
[0170] It should be noted that the Gated Recurrent Unit is a variant of a recurrent neural network that controls the fusion ratio of historical hidden states with new input information through a learnable "update gate" and controls the influence of historical hidden states on the current candidate state through a "reset gate," thereby effectively modeling sequence dependencies.
[0171] Step S316: Stack several layers of directional decoupled graph coding layers in the same way, and use all node features output from the previous layer as input to the next layer.
[0172] Specifically, stack them in the same way. The layer-wise decoupled graph encoding layer takes all symptom mention node features output from the previous layer as input to the next layer. Specifically, the first layer of the decoupled graph encoding layer uses the initial features of the symptom mention nodes. As input, the The layer-direction decoupled graph encoding layer outputs the final node features of each symptom-mentioned node. This indicates the total number of layers in the directional decoupling graph encoder; an example value is 3.
[0173] It should be noted that through multi-layer directional decoupling graph message passing, symptom mention nodes can gradually aggregate multi-hop pathological causal information, while reducing the interference of irrelevant causal directions through precursor directional parameters, secondary directional parameters and causal direction gating coefficients.
[0174] In one embodiment, for slots that require tracing preceding information related to dysmenorrhea, the model can increase the causal direction gating coefficient of the dysmenorrhea symptom mention node based on the current state of the symptom mention node and the global dialogue intent, thereby improving the aggregation of preceding neighbor messages. The participation ratio in node updates. For coexisting symptom-related slots, the model can reduce the causal direction gating coefficient of the corresponding central symptom-mentioning node, thereby improving the aggregation of secondary neighbor messages. The participation rate was increased, and information related to symptoms such as deep triggered pain, defecation pain, and chronic pelvic pain was enhanced.
[0175] It should be noted that the causal direction gating coefficient is not directly set based on a fixed slot category, but is jointly determined through training by the current state of the symptom mention node and the global dialogue intent. Therefore, the same symptom mention node can adopt different causal message fusion ratios under different patient dialogues and different consultation focuses.
[0176] Step S32: Arrange the node features after multi-layer encoding in the order of appearance to obtain the final node representation sequence, and perform differential pooling on the final features of the corresponding nodes according to the ontology type of each slot in the endometriosis knowledge graph to obtain the slot-specific graph context representation corresponding to each slot type.
[0177] Specifically, such as Figure 6 As shown, this step organizes the features of the symptom mention nodes after completing the L-layer directional decoupling graph encoding, and performs differential pooling based on the ontology type of the slot in the endogenous symptom knowledge graph to generate slot-specific graph context representations.
[0178] In the description of this invention, the final node representation sequence is obtained by arranging the node features after multi-layer encoding in the order of appearance, and differential pooling is performed on the final features of the corresponding nodes according to the ontology type of each slot in the endometriosis knowledge graph to obtain the slot-specific graph context representation corresponding to each slot type, including:
[0179] Step S321: Arrange the final node features of each symptom mention node in each layer according to the order of their appearance in the compressed structured dialogue sequence to obtain the final node representation sequence.
[0180] Specifically, according to the order in which the symptom mention nodes appear in the compressed structured dialogue sequence, each symptom mention node is arranged in the order of its appearance in the sequence. The final node features of the layer are used to obtain the final node representation sequence. That is... .
[0181] in, The nodes ultimately represent sequences, with a dimension of . ; Indicates the first The symptom mention node in the first The final node feature of the layer has a dimension of ; This indicates the sequential index of the symptom mention nodes; This indicates the total number of nodes mentioned in the symptom list; This indicates the total number of layers in the directional decoupling graph encoder; This indicates that multiple node features are arranged in rows to form a matrix.
[0182] It should be noted that the nodes ultimately represent sequences. Preserve the independent position and original text position mapping relationship of each symptom mention node, so that the subsequent intent-aware dynamic slot decoder can calculate the start and end positions of slot filling within the range of symptom mention nodes.
[0183] Step S322: For each slot type in the predefined endometriosis symptom slots, read the ontology type of the slot type in the endometriosis knowledge graph, and determine the corresponding set of candidate center nodes based on the ontology type.
[0184] Specifically, the complete set of predefined endometriosis symptom slots is formed by combining all predefined endometriosis symptom slots; [This refers to the complete set of predefined endometriosis symptom slots.] Each slot type Read slot type In the endometriosis knowledge graph, ontology types are identified, and a corresponding set of candidate center nodes is determined based on these ontology types. This represents the set of all predefined endometriosis symptom slots; This indicates the slot type identifier.
[0185] In practical implementation, candidate center nodes refer to standardized symptom concepts and slot types. Symptom mention nodes that match the corresponding symptom ontology. For example, for the dysmenorrhea severity slot, symptom mention nodes with the standardized symptom concept of dysmenorrhea are identified as candidate central nodes; for the deep trigger pain trigger slot, symptom mention nodes with the standardized symptom concept of deep trigger pain are identified as candidate central nodes; for the chronic pelvic pain location slot, symptom mention nodes with the standardized symptom concept of chronic pelvic pain are identified as candidate central nodes.
[0186] When multiple candidate center nodes correspond to the same slot type, all candidate center nodes are retained, enabling the slot-specific graph context representation to comprehensively integrate the progressive descriptions of the same symptom across multiple consultation rounds. Through ontology type matching, symptom mention nodes unrelated to the current slot can be avoided from being directly included in the slot-specific graph context representation.
[0187] Step S323: Based on the ontology type corresponding to the slot type, select nodes to participate in pooling from the candidate center node and the causal neighborhood of the candidate center node, and perform the pooling operation corresponding to the slot type on the final node features of the corresponding nodes to obtain the slot-specific graph context representation.
[0188] Specifically, depending on the slot type For the corresponding ontology category, symptom mention nodes are selected from the candidate center node and its causal neighborhood to participate in pooling. Then, pooling operations corresponding to the slot type are performed on the final node features of the corresponding symptom mention nodes to obtain a slot-specific graph context representation. ,and .
[0189] in, Indicates slot type The corresponding slot-specific graph context representation has dimensions of ; Indicates slot type The corresponding pooling operation; The node ultimately represents a sequence.
[0190] In one implementation, for a disease-related slot, the medical precursor neighbor nodes of the candidate center node are read, and the final node features of the candidate center node and its medical precursor neighbor nodes are subjected to mean pooling, so that the slot-specific graph context representation focuses on retaining the possible precursor symptom information.
[0191] For performance-related slots, the final node features of the candidate center node are directly read without additional aggregation of causal neighbors. When there are multiple candidate center nodes, mean pooling is performed on the final node features of multiple candidate center nodes so that the slot-specific graph context representation retains the degree, time, duration, location, and triggering information of the symptom itself.
[0192] For slots with coexisting symptoms, read all first-order neighbor nodes of the candidate center node, and perform max pooling along the node dimension on the final node features of the candidate center node and all first-order neighbor nodes, so that the high response generated by at least one significantly associated symptom can be preserved.
[0193] It should be noted that when the slot type When no corresponding candidate center node exists, the slot-specific graph context representation is used. Set as The zero-dimensional vector enables the subsequent intent-aware dynamic slot decoder to determine whether a slot is empty primarily based on slot type embedding and global dialogue intent, avoiding the generation of slot-specific graph context representations from irrelevant symptom mention nodes.
[0194] The output node ultimately represents the sequence. Slot-specific graph context representation for each slot type (Specifically output by the directional decoupling graph encoder). The nodes ultimately represent sequences. Used for subsequent intent-aware dynamic slot decoders to locate specific symptom-related nodes; slot-specific graph context representation. This is used to enhance the semantic differences between different slot types, enabling causal neighborhood information of etiology slots, manifestation slots, and coexisting symptom slots to be utilized from different ranges.
[0195] It should be noted that the final node representation sequence retains node-level positioning capabilities, while the slot-specific graph context representation provides slot-level global conditions. These two are used for slot fill value positioning and slot query construction, respectively, to avoid directly using a single vector after graph pooling for all slots and losing the specific symptom mention location.
[0196] It should be noted that the specific hierarchical structure of the directional decoupling graph encoder is shown in Table 1.
[0197] Table 1: Hierarchical structure of the directional decoupling map encoder
[0198] Step S4: Fuse the slot-specific graph context representation with the slot type embedding in the predefined endogenous symptom slots and the global dialogue intent vector to generate an intent-aware query vector and predict the start and end positions of slot filling; Based on the start and end positions of all slots, perform joint loss optimization by fusing the symptom causal chain distribution alignment to obtain the trained slot filling model.
[0199] Specifically, slot filling requires determining the most matching range of symptom mentions for each predefined slot from the final representation sequence of nodes. Since doctors may have different inquiries in different consultation conversations, it is difficult to adapt to changes in the current consultation intent by using only fixed slot type embedding.
[0200] This invention integrates slot type embedding, global dialogue intent vector, and slot-specific graph context representation to generate intent-aware query vector in the current consultation context. Then, it predicts the start and end positions of slot filling through multi-head pointer attention and performs joint optimization using symptom causal chain distribution alignment regularization terms.
[0201] In the description of this invention, the slot-specific graph context representation is fused with the slot type embedding in the predefined endogenous symptom slots and the global dialogue intent vector to generate an intent-aware query vector and predict the start and end positions of slot filling; based on the start and end positions of all slots, joint loss optimization is performed by fusing symptom causal chain distribution alignment to obtain the trained slot filling model, including:
[0202] Step S41: Generate an intent-aware query vector for each slot type in the current consultation context, and match the intent-aware query vector with each node in the final node representation sequence to obtain the probability distribution of the slot filling start position and the probability distribution of the end position.
[0203] Specifically, such as Figure 7 As shown, this step generates an intent-aware query vector for each slot type and matches the intent-aware query vector with each symptom mention node in the final node representation sequence to obtain the probability distribution of the slot filling start position and the probability distribution of the end position.
[0204] In the description of this invention, an intent-aware query vector is generated for each slot type in the current consultation context, and the intent-aware query vector is matched with each node in the final node representation sequence to obtain the probability distribution of the slot filling start position and the probability distribution of the end position, including:
[0205] Step S411: Set a learnable slot type embedding for each slot type in the predefined endometriosis symptom slots to encode the fixed semantics of the slot type.
[0206] Specifically, for the complete set of predefined endometriosis symptom slots Each slot type Set learnable slot type embedding Slot type embedding The fixed semantics used to encode slot types, such as semantic differences between dysmenorrhea severity, dysmenorrhea duration, deep triggering pain precipitates, and locations of chronic pelvic pain, are denoted by the dimension . .
[0207] At the start of model training, the embeddings for each slot type can be randomly initialized and updated using a joint loss function. Different slot types correspond to independent slot type embeddings, enabling the model to learn the symptom concepts and attribute types relevant to each slot.
[0208] Step S412: Concatenate the slot type embedding, global dialogue intent vector, and slot-specific graph context representation along the feature dimension, and perform affine transformation and layer normalization in sequence to obtain the intent-aware query vector of the slot type in the current consultation dialogue.
[0209] Specifically, embed the slot type Global dialogue intent vector Contextual representation of slot-specific graphs The slot types are obtained by concatenating along the feature dimensions and then performing affine transformation and layer normalization sequentially. The intent-aware query vector in the current consultation dialogue is represented as follows:
[0210] ;
[0211] in, Indicates slot type The intent-aware query vector in the current consultation dialogue has a dimension of [dimensionality]. ; Indicates slot type The slot type embedding, with dimensions of ; Represents the global dialogue intent vector, with dimensions of ; Indicates slot type The corresponding slot-specific graph context representation has dimensions of ; This represents the trainable weight matrix in the query fusion process, with dimension 1. ; This represents the trainable bias vector during the query fusion process, with dimension . ; The representation layer normalization operation is used to ensure that the intent-aware query vector maintains a stable feature scale across different consultation samples.
[0212] It should be noted that intent-aware query vectors It also includes the inherent semantics of the slot, the overall intent of the current consultation, and the causal graph context corresponding to the slot type. For example, when the focus of the current consultation is the time pattern of symptoms, time-related slot queries can improve the matching degree of symptom mention nodes associated with time expressions such as "day 1 of menstruation" or "lasts for 2 days".
[0213] Step S413: Set learnable empty node features outside the final node representation sequence, and concatenate the empty node features with the final node representation sequence along the node dimension to obtain the extended node representation sequence.
[0214] Specifically, the nodes ultimately represent sequences. In addition, set learnable empty node features and empty node features The final representation sequence of nodes Concatenating along the node dimension yields an expanded node representation sequence. This sequence includes features for empty nodes. The dimension is This is used to indicate that no slot type appears in the current consultation. The corresponding fill value.
[0215] In practical implementation, the feature of empty nodes Symptom mention nodes that are not part of the final symptom heterogeneous causal graph do not participate in directional decoupling graph message passing; they only participate in score calculation as additional candidate positions when predicting the start and end positions of slots. Extended nodes indicate sequences containing... There are 1 symptom mentioning a node location and 1 empty node location, therefore the total number of corresponding candidate locations is 1. .
[0216] Step S414: For each candidate position in the extended node representation sequence, calculate the score of the candidate position as the starting position for slot type filling using a preset number of pointer attention heads.
[0217] Specifically, for each candidate position in the extended node representation sequence... , respectively Each pointer attention head calculates the candidate position as the slot type. Fill in the fraction at the starting position. Among them, At that time, candidate position Corresponding to the Each symptom is mentioned at a specific point; At that time, candidate position Corresponding empty node features .
[0218] Furthermore, each pointer attention head first selects candidate positions. Corresponding node features and intent-aware query vector Projecting the two projections into the same attention feature space, summing the two projections and performing hyperbolic tangent activation, and finally mapping them to scalar scores through trainable scoring vectors, then... The scalar scores of the outputs of the attention heads are averaged to obtain the initial position attention score, which is represented as:
[0219] ;
[0220] in, Candidate positions As a slot type Attention score for filling in the starting position; This refers to the number of pointer attention points; an example value is 8. For pointer attention head index; Candidate positions The corresponding node features, when hour, ,when hour, ;
[0221] Indicates the first A trainable scoring vector for each starting position pointer attention head; Indicates the first The trainable matrix used to project candidate node features in the attention head of each starting position pointer; Indicates the first The trainable matrix used to project the intent-aware query vector in the attention head of each starting position pointer; Indicates the first A trainable bias vector for each starting position pointer attention head.
[0222] It should be noted that multi-head pointer attention uses independent parameters to determine the degree of matching between candidate node features and slot types from different semantic subspaces, which can reduce the dependence of single attention projection on specific patient expression patterns.
[0223] Step S415: After normalizing the start position scores of all candidate positions, take the one with the highest probability as the prediction start index; after normalizing the end position scores of all candidate positions, take the one with the highest probability as the prediction end index.
[0224] Specifically, the slot type All corresponding The attention scores at each starting position are input into the Softmax function to obtain the probability distribution of the starting positions for slot filling. The position with the highest probability is taken as the starting index for prediction, as follows:
[0225] ;
[0226] ;
[0227] in, This represents the Softmax function; Indicates slot type The probability distribution of the starting position of slot filling, with dimension . ; Indicates candidate position The probability of the starting position for slot filling; Indicates slot type The predicted starting index.
[0228] Furthermore, the slot filling end position is calculated using the same process as the initial position prediction, but the end position prediction uses an independent projection matrix, bias vector, and scoring vector. The end position attention scores for all candidate positions are then Softmax normalized to obtain the probability distribution of the slot filling end position. The candidate position with the highest probability is taken as the prediction end index. .
[0229] It should be noted that the start position prediction parameters and end position prediction parameters are independent, enabling the model to separately learn the start and end boundaries of the symptom mention range corresponding to the slot fill value. When both the prediction start index and prediction end index point to an empty node position, the slot type is... The filling result is determined to be empty.
[0230] Step S416: When both the prediction start index and the prediction end index point to a node, restore the slot filling value according to the original text position stored in that node; otherwise, determine the slot filling result as empty.
[0231] Specifically, when predicting the starting index and prediction end index When both references point to symptom mention nodes, the slot fill value is restored based on the original text position saved by the corresponding symptom mention node. Specifically, if... Read the symptom mention node and its associated attribute records related to the slot type. The matched original text fragment; if Read the original text range between the start text position of the symptom mention node corresponding to the prediction start index and the end text position of the symptom mention node corresponding to the prediction end index, and then determine the range based on the slot type. Preserve the corresponding attribute expression.
[0232] In the specific implementation, for degree-type slots, the degree modification expression associated with the candidate central symptom mention is read from the predicted text range; for time-type slots, the corresponding time expression or duration expression is read; for location-type slots, the corresponding location expression is read; for precipitate-type slots, the corresponding precipitate expression is read; and for coexisting symptom-type slots, the standardized relevant symptom mention text within the predicted range is read.
[0233] In one implementation, when the independently obtained prediction end index is less than the prediction start index, the candidate position combination that satisfies the condition that the end index is not less than the start index is selected. The combination with the largest value is used as the corrected prediction start index and prediction end index to avoid generating slot filling ranges with invalid order.
[0234] It should be noted that the empty node feature is only used to determine whether a slot is missing. When either the start or end position points to an empty node position, the corresponding slot filling result is determined to be empty, avoiding the use of empty node positions and symptom mention node positions to form an incomplete text range.
[0235] Step S42: The sum of the negative log-likelihood loss at the start position and the negative log-likelihood loss at the end position for all slot types is used as the main loss. The distance between the node attention distributions of slot pairs with direct pathological causal relationships is used as the regularization term. The main loss and the regularization term are weighted and combined to obtain the joint loss function. The joint loss function is used as the training objective to optimize the model and obtain the trained slot filling model.
[0236] Specifically, this step introduces attention distribution alignment constraints between slot pairs with direct pathological causal relationships, based on the supervised loss of the slot filling start and end positions, so that the attention areas of related slots remain consistent at the symptom mention nodes.
[0237] In the description of this invention, the sum of the negative log-likelihood loss at the start position and the negative log-likelihood loss at the end position for all slot types is used as the main loss, and the node attention distribution distance between slot pairs with direct pathological causal relationship is used as the regularization term. The main loss and the regularization term are weighted and combined to obtain a joint loss function. The joint loss function is used as the training objective for model optimization, resulting in a trained slot filling model including:
[0238] Step S421: Read the manually labeled true start position index and true end position index for each slot type, and read the predicted probability of the corresponding position from the probability distribution of the slot filling start position and the probability distribution of the slot filling end position, respectively.
[0239] Specifically, for each slot type Read the actual starting position index of the manually labeled text. and the actual end position index The probability distribution of the starting position of slot filling. Probability distribution of slot filling end position Read the predicted probability of the corresponding position.
[0240] in, Indicates slot type The actual starting position index; Indicates slot type The true start and end position indices are determined based on the symptom mention node positions associated with the slot fill values for slots with fill values. For slots without corresponding fill values, both the true start and end position indices point to empty node features. The corresponding position.
[0241] Furthermore, by taking the negative logarithm of the predicted probabilities of the true starting position and the true ending position, the slot type is obtained. The starting position negative log-likelihood loss and ending position negative log-likelihood loss are used. Through the above supervision, the model improves the prediction probability of the true slot filling position and reduces the prediction probability of irrelevant symptom mention nodes and empty node positions.
[0242] Step S422: Read the direct pathological causal relationships between slot entities from the endometriosis knowledge graph and establish a set of causal slot pairs.
[0243] Specifically, the direct pathological causal relationships between slot ontologies are extracted from the endometriosis knowledge graph to establish a set of causal slot pairs. causal slot pair set Each element in Indicates slot type and slot type There are predetermined direct pathological causal relationships in the endometriosis knowledge graph.
[0244] In practice, the set of causal slot pairs is determined before model training based on the slot ontology relationships in the endometriosis knowledge graph and remains unchanged during training. For example, when the endometriosis knowledge graph configures two symptom slots with a direct pathological causal relationship, the corresponding slot types are paired as causal slot pairs. For slot types that do not have a direct pathological causal relationship established in the endometriosis knowledge graph, they are not added to the set of causal slot pairs to avoid forcibly aligning the attention distribution of slots without a clear medical connection.
[0245] In the specific implementation, the construction rule for causal slot pairs is: if the two slot types are... and If the corresponding slot entity has a direct pathological causal relationship in the endometriosis knowledge graph, such as "causing," "exacerbating," or "comorbid," (i.e., the two symptom concept entities are connected by a direct pathological causal edge), then... Add to set as a causal slot pair ;gather Before model training, slots are pre-set and fixed according to the knowledge graph, and do not include slot combinations that have only indirect paths or no direct pathological connections.
[0246] It should be noted that the slot ontology refers to the symptom concept entity corresponding to each predefined endometriosis symptom slot in the endometriosis knowledge graph.
[0247] Step S423: For each slot type, calculate the attention distribution vector of that slot type on each symptom mention node based on the score of each attention head pair node in the multi-head pointer attention mechanism.
[0248] Specifically, for each slot type Read them separately Attention to the starting position pointer Each symptom mentions the starting position score generated by the node, and then, for each pointer, attention is paid to the internal structure of the head. Softmax normalization is performed on the scores of each symptom mention node to obtain the attention distribution of the symptom mention nodes corresponding to the attention head of that pointer. Then... The average of the attention distribution of each symptom-related node is used to obtain the slot type. Node attention distribution vector .
[0249] in, Indicates slot type exist The node attention distribution vectors on the nodes mentioned by each symptom have dimensions of . ; The first in Each component represents the slot type. When making slot filling decisions, the first The average attention level of each symptom-mentioned node. The node attention distribution vector is calculated without including empty node positions, and the symptom causal chain distribution alignment regularization term only constrains the attention relationships between actual symptom-mentioned nodes.
[0250] Step S424: For each slot pair in the causal slot pair set, calculate the distance between the attention distribution vectors of the two slot types and sum them to obtain the symptom causal chain distribution alignment regularization term.
[0251] Specifically, for the set of causal slot pairs Each slot pair Calculate slot type Node attention distribution vector With slot type Node attention distribution vector The squared distance between the causal slots (i.e., the square of the Euclidean distance) is summed over all causal slot pairs to obtain the symptom causal chain distribution alignment regularization term.
[0252] It's important to note that a smaller node attention distribution distance indicates that two slots with a direct pathological causal relationship focus on symptom mention regions more closely during slot filling. Reducing the node attention distribution distance can decrease the likelihood of related slots focusing on unrelated symptom mention nodes. The symptom causal chain distribution alignment regularization only requires consistency in the attention regions of related slots, not that two slots output the same slot filling value. Different slots still determine their specific filling values through their own independent slot type embedding, intent-aware query vectors, and start / end position supervision.
[0253] Step S425: Combine the sum of the start position loss and end position loss for all slot types with the regularization term to obtain the joint loss function.
[0254] Specifically, the joint loss function is obtained by combining the negative log-likelihood loss of the starting position, the negative log-likelihood loss of the ending position, and the symptom causal chain distribution alignment regularization term for all slot types, as follows:
[0255] ;
[0256] in, Represents the joint loss function; This represents the complete set of predefined endometriosis symptom slots; Indicates slot type Index at the actual starting position The predicted probability at that location; Indicates slot type Index at the actual end position The predicted probability at that location;
[0257] Represents the set of causal slot pairs; Indicates slot type The node attention distribution vector; Indicates slot type The node attention distribution vector; This represents the squared L2 norm of the vector difference; This represents the weight adjustment parameter for the symptom causal chain distribution alignment regularization term, used to control the degree of influence of the symptom causal chain consistency constraint on model training. An example value is 0.1.
[0258] It should be noted that the first part of the joint loss function supervises the model to accurately locate the slot filling range through the true start position and the true end position, while the second part constrains the node attention distribution of related slots through the pathological causal relationship in the endometriosis knowledge graph. This allows the model to maintain the accuracy of slot location while reducing the possibility of medical logic conflicts caused by independent predictions of different slots.
[0259] Step S426: Using the joint loss function as the model training objective, update the parameters involved in training, the orientation decoupling graph encoder parameters, the slot type embedding, the empty node features, the multi-head pointer attention parameters, and the query fusion parameters in the biomedical pre-trained language model through backpropagation; after each training cycle, use the validation set to calculate the slot-level precision, slot-level recall, and slot-level F1 score, and save the model parameters corresponding to the highest slot-level F1 score in the validation set, thus obtaining the trained slot-filling model.
[0260] Specifically, using the joint loss function As the training objective, backpropagation is used to update the parameters involved in training the medical BERT, including the orientation decoupled graph encoder parameters, slot type embeddings, empty node features, multi-head pointer attention parameters, and query fusion parameters. After each training cycle, the slot-level precision, slot-level recall, and slot-level F1 score are calculated using the validation set. The model parameters corresponding to the highest slot-level F1 score on the validation set are saved, resulting in the trained endometriosis symptom slot-filling model.
[0261] It should be noted that the symptom causal chain distribution alignment regularization term is used as an auxiliary training constraint and does not replace the supervision of the true start and true end positions. The parameters are adjusted through weights. Controlling the influence of regularization terms on the symptom causal chain distribution can prevent different slots from losing their independent positioning capabilities due to over-alignment.
[0262] It should also be noted that the specific structure of the intent-aware dynamic slot decoding model is shown in Table 2.
[0263] Table 2: Specific Structure of the Intent-Aware Dynamic Slot Decoding Model
[0264] Step S5: Use the trained slot filling model to fill slots in the current multi-round consultation dialogue and output the filling results of each slot.
[0265] Specifically, after the model training is completed, the trained endometriosis symptom slot filling model is deployed to the endometriosis auxiliary consultation system. The system receives the original multi-round consultation dialogue of the current patient and adopts the same endometriosis specialist dictionary, time expression conversion rules, symptom concept standardization rules and endometriosis knowledge graph as in the training phase.
[0266] First, following step S21, symptom mention recognition, virtual time stamp generation, symptom transfer point recognition, doctor inquiry intent recognition, and question-and-answer intent fragment filtering are performed on the current original multi-turn consultation dialogue to obtain the current compressed structured dialogue sequence. Following step S22, a heterogeneous causal graph of the current symptoms is constructed, and following steps S31 and S32, the final representation sequence of the current node and the slot-specific graph context representation corresponding to each slot type are generated. Finally, following step S41, the probability distribution of the slot filling start position and the probability distribution of the slot filling end position corresponding to each slot type are generated, and the slot filling value is restored based on the predicted start index, predicted end index, and the original text position saved by the symptom mention node.
[0267] The output results are structured and stored according to predefined endometriosis symptom slots. Each slot contains at least a slot type, a slot fill value, the corresponding original text position, and whether it is empty. When the start or end position is predicted to be an empty node position, the corresponding slot fill value is output as empty. When the prediction result corresponds to an actual symptom mention node, the corresponding degree expression, time expression, duration expression, location expression, cause expression, or symptom mention text is read from the original multi-turn consultation dialogue as the final slot fill value.
[0268] In one embodiment, for example, suppose the deployed model receives a new multi-turn consultation dialogue. If a patient describes experiencing "severe lower abdominal pain during menstruation and bowel movements for nearly a year, which has worsened in the past six months and is accompanied by deep pain during intercourse," then the following steps should be performed:
[0269] ① Constructing a compressed sequence: The system executes step S21, identifying symptoms such as "severe lower abdominal pain" (dysmenorrhea), "pain during bowel movements" (defecation pain), and "deep pain" (deep triggered pain); through time expression recognition and doctor intent analysis, it filters out question-and-answer segments containing symptom transfer points and key follow-up questions, and splices them together. ;
[0270] ② Construct a heterogeneous causal graph: Perform step S22, standardize the above-mentioned symptoms and use them as nodes. At the same time, establish co-occurrence edges Furthermore, it extracts the "causing" or "exacerbating" relationships between them from the knowledge graph, establishing a medical causal boundary. Adaptive weights are calculated for causal edges by combining the temporal order and semantic similarity in the dialogue. The final symptom heterogeneity causal graph was constructed. ;
[0271] ③Graph Coding: Execute steps S31 and S32 to encode the graph. conduct Layer-direction decoupling graph encoding; for example, for the "defecation pain" node, its predecessor aggregation message will capture information from the "menstrual pain" node, and the successor message may be empty; the final generated node representation sequence. and a dedicated graph context representation generated for each slot. ;
[0272] ④ Slot Decoding: Execute step S41 to generate an intent-aware query vector for the "Defecation Pain Level" slot. and with Calculate pointer attention to obtain the probability distribution of the start and end positions; the model predicts that it will point to the symptom mention node "pain during defecation";
[0273] ⑤ Output results: Based on the predicted index, the system restores the slot filling value of "Defecation pain level" from the original text to "Also painful", and outputs it in a structured manner: {Slot type: "Defecation pain level", Fill value: "Also painful", Text position: "Round X...", Whether empty: No}.
[0274] In one embodiment, such as Figure 8 As shown in the bar chart, the F1 scores for slot filling are compared for different slot types. Specifically, the F1 scores of our method (causal graph and directional decoupling) are compared with those of three baseline methods (BERT-BiLSTM-CRF, BERT-MRC, and TextGCN) on eight endometriosis-related symptom slots. Our method achieved the highest F1 scores on all slot types, demonstrating that fusing medical causal graphs and directional decoupling message passing can effectively improve the filling capability of complex symptom slots in multi-round consultations. The horizontal axis represents the symptom slot type, without units; the vertical axis represents the slot filling F1 score, without units (score value).
[0275] In another embodiment of the present invention, a slot filling system for endometriosis-related symptoms for multi-round consultation dialogues is also provided, comprising:
[0276] The data acquisition and annotation module is used to acquire the original multi-round consultation dialogue and determine the predefined endometriosis symptom slots;
[0277] The symptom heterogeneous causal graph construction module is used to construct a symptom heterogeneous causal graph based on the original multi-turn consultation dialogue; the symptom heterogeneous causal graph uses symptom mentions as nodes, and the nodes include at least co-occurrence edges and medical causal edges;
[0278] The directional decoupling graph encoding module is used to encode the symptom heterogeneous causal graph. It divides the neighbors of each node into predecessor neighbors and successor neighbors according to the direction of the medical causal edge, and performs differential pooling processing on each of them to generate a global dialogue intent vector and a slot-specific graph context representation.
[0279] The intent-aware dynamic slot decoding module is used to fuse the slot-specific graph context representation with the slot type embedding in the predefined endogenous symptom slots and the global dialogue intent vector to generate an intent-aware query vector and predict the start and end positions of slot filling. Based on the start and end positions of all slots, the joint loss is optimized by fusing the symptom causal chain distribution alignment to obtain the trained slot filling model.
[0280] The online fill module is used to fill the slots in the current multi-round consultation dialogue using the trained slot filling model and output the filling results of each slot.
[0281] In summary, by utilizing the above-mentioned technical solutions of this invention, this invention constructs an adaptive symptom heterogeneous causal graph that integrates pathological causality and temporal consistency. By combining the static pathological pathways in the endometriosis knowledge graph with the virtual temporal sequence of actual symptom occurrences during the current consultation, the weights of medical causal edges can be dynamically adjusted according to the symptom evolution process of different patients, thus avoiding the fixed use of knowledge graph relationships.
[0282] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
Claims
1. A method for filling symptom slots related to endometriosis in multi-round consultation dialogues, characterized in that, include: S1. Obtain the original multi-round consultation dialogue and determine the predefined endometriosis symptom slots; S2. Construct a symptom heterogeneous causal graph based on the original multi-round consultation dialogue; the symptom heterogeneous causal graph uses symptom mentions as nodes, and the nodes include at least co-occurrence edges and medical causal edges; S3. Encode the symptom heterogeneous causal graph, divide the neighbors of each node into predecessor neighbors and successor neighbors according to the direction of the medical causal edge, and perform differential pooling processing on each, to generate a global dialogue intent vector and a slot-specific graph context representation. S4. The slot-specific graph context representation is fused with the slot type embedding in the predefined endometriosis symptom slots and the global dialogue intent vector to generate an intent-aware query vector and predict the start and end positions of slot filling. Based on the start and end positions of all slots, the joint loss is optimized by fusing the symptom causal chain distribution alignment to obtain the trained slot filling model. S5. Use the trained slot filling model to fill slots in the current multi-round consultation dialogue and output the filling results of each slot.
2. The method for filling symptom slots related to endometriosis in multi-round consultation dialogues according to claim 1, characterized in that, The construction of the symptom heterogeneity causal graph based on the original multi-round consultation dialogue includes: S21. Identify symptom mentions, time expressions, and doctor's inquiry intent from the original multi-turn consultation dialogue, and filter question and answer intent fragments according to the doctor's inquiry intent to obtain a compressed structured dialogue sequence. S22. Standardize the symptom mentions in the compressed structured dialogue sequence into symptom concepts in the endometriosis knowledge graph, and use each standardized symptom mention as an independent node to calculate the medical causal edge weights and construct a symptom heterogeneous causal graph.
3. The method for filling symptom slots related to endometriosis in multi-round consultation dialogues according to claim 2, characterized in that, The process of identifying symptom mentions, time expressions, and doctor's inquiry intent from the original multi-turn consultation dialogue, and filtering question-and-answer intent fragments based on the doctor's inquiry intent to obtain a compressed structured dialogue sequence includes: S211. Divide the original multi-round consultation dialogue into multiple consultation rounds according to the original consultation order, and save the round index and discourse role for each utterance; use the endometriosis specialist dictionary to identify symptom mentions in each consultation round, and map the symptom expressions in the patient's natural language to the corresponding symptom concepts. S212. Convert the time expressions associated with each symptom into virtual time markers for comparison of their order of occurrence, and set the start time of the current original multi-round consultation dialogue as the origin of the virtual timeline; S213. Organize the symptom mentions in each consultation round according to the symptom concept and virtual time markers to form a symptom time event sequence, and arrange multiple symptom mentions of the same symptom concept in different consultation rounds according to the actual symptom occurrence time and consultation round order; S214. Input each doctor's utterance and the corresponding patient's response into a lightweight dialogue behavior classifier to obtain the doctor's inquiry intent label for the current consultation round. S215. Check adjacent consultation rounds according to the consultation round order, and determine whether adjacent consultation rounds are similar based on the symptom concept and the doctor's inquiry intention label. Merge adjacent consultation rounds that revolve around the same symptom concept and whose doctor's inquiry intention belongs to the same progressive consultation chain into question and answer intention segments. S216. Examine each of the generated question-and-answer intent fragments, and retain only those containing at least one symptom transfer point or at least one key diagnostic follow-up question. Then, splice the retained question-and-answer intent fragments together according to the original consultation order to obtain a compressed structured dialogue sequence.
4. The method for filling symptom slots related to endometriosis in multi-round consultation dialogues according to claim 2, characterized in that, The process of standardizing symptom mentions in the compressed structured dialogue sequence into symptom concepts in the endometriosis knowledge graph, and using each standardized symptom mention as an independent node to calculate medical causal edge weights and construct a symptom heterogeneous causal graph includes: S221. Extract all symptom mentions from the compressed structured dialogue sequence, and map each symptom mention to a unique symptom concept in the endometriosis knowledge graph based on the mapping relationship of standard names, synonyms and aliases in the endometriosis specialist dictionary. S222. Generate an independent node for each symptom mention, and generate initial node features for each node; the initial node features are obtained by concatenating the context semantic vector with the structural embedding vector of the corresponding symptom concept in the endometriosis knowledge graph; S223. Using all standardized symptom mentions as nodes, establish a node set; establish an undirected co-occurrence edge for any two nodes in the compressed structured dialogue sequence whose text distance is lower than a preset distance threshold, and form a co-occurrence edge set from all undirected co-occurrence edges. S224. For any two nodes in the node set, when there is a pathological causal path between the two corresponding symptom concepts in the endometriosis knowledge graph, establish candidate medical causal edges according to the causal direction, and form a medical causal edge set by all candidate medical causal edges. S225. Determine static medical knowledge items based on the pathological relationship characteristics and path distance between the two symptom concepts corresponding to each candidate medical causal edge, and determine dynamic temporal semantic items based on the order of virtual time stamps and contextual semantic similarity of the two nodes corresponding to the candidate medical causal edge; input the static medical knowledge items and dynamic temporal semantic items into the activation function to obtain the medical causal edge weight of the candidate medical causal edge, and form an edge weight set with the preset co-occurrence edge weights. S226. Combine the node set, co-occurrence edge set, medical causal edge set, and corresponding edge weight set to obtain the initial symptom heterogeneous causal graph; S227. For each node, retain the maximum number of neighbor connections according to the corresponding edge weight from largest to smallest to obtain the final symptom heterogeneous causal graph.
5. The method for filling symptom slots related to endometriosis in multi-round consultation dialogues according to claim 1, characterized in that, The encoding of the symptom heterogeneous causal graph involves dividing each node's neighbors into predecessor and successor neighbors according to the direction of the medical causal edges, and performing differential pooling processing on each, generating a global dialogue intent vector and a slot-specific graph context representation, including: S31. During the encoding process of the heterogeneous causal graph of symptoms at each layer, the preceding neighbor aggregation message and the subsequent neighbor aggregation message are calculated respectively, and the causal direction gating coefficient is generated according to the current node state and the global dialogue intent. The node features mentioned by the symptoms are updated through the gating loop unit. S32. Arrange the node features after multi-layer encoding in the order of appearance to obtain the final node representation sequence. Perform differential pooling on the final features of the corresponding nodes according to the ontology type of each slot type in the endometriosis knowledge graph to obtain the slot-specific graph context representation corresponding to each slot type.
6. The method for filling symptom slots related to endometriosis in multi-round consultation dialogues according to claim 5, characterized in that, The process of encoding the heterogeneous causal graph of symptoms at each layer involves calculating the predecessor neighbor aggregation message and the successor neighbor aggregation message, generating causal direction gating coefficients based on the current node state and global dialogue intent, and updating the node features mentioned in the symptoms through a gating loop unit, including: S311. For any target node, nodes that point to the target node through medical causal incoming edges are classified as medical predecessor neighbors, and medical predecessor neighbors are formed into a medical predecessor neighbor set; nodes that are pointed to by the target node through medical causal outgoing edges are classified as medical secondary neighbors, and medical secondary neighbors are formed into a medical secondary neighbor set; nodes that are connected to the target node through co-occurrence edges are formed into a co-occurrence neighbor set. S312. For each neighbor node in the predecessor aggregated neighbor set, select the corresponding predecessor direction transformation matrix according to the edge relationship type to project the features of the neighbor node, calculate the predecessor attention weight through the attention mechanism, and perform weighted summation of the projected features of all predecessor neighbors to obtain the predecessor neighbor aggregated message. S313. For each neighbor node in the secondary aggregated neighbor set, perform relation type selection, neighbor node feature projection, central node and neighbor node relation fusion, edge weight fusion and attention normalization using the secondary direction independent parameters in the same processing order as the predecessor direction message aggregation, to obtain the secondary neighbor aggregated message of the target node in the current layer. S314. Input the compressed structured dialogue sequence into the biomedical pre-trained language model, read the output vector corresponding to the classification label of the biomedical pre-trained language model, and obtain the global dialogue intent vector. S315. Based on the causal direction gating coefficient, the aggregated messages of predecessor neighbors and the aggregated messages of successor neighbors are weighted and fused to obtain the causal neighborhood input message of the target node in the current layer, and the causal neighborhood input message is input into the gating loop unit to update the current node features. S316. Stack several layers of directional decoupled graph coding layers in the same way, and use all node features output from the previous layer as input to the next layer.
7. The method for filling symptom slots related to endometriosis in multi-round consultation dialogues according to claim 5, characterized in that, The process of arranging the node features after multi-layer encoding in the order of appearance to obtain the final node representation sequence, and performing differential pooling on the final features of the corresponding nodes according to the ontology type of each slot in the endometriosis knowledge graph, to obtain the slot-specific graph context representation corresponding to each slot type, includes: S321. Arrange the final node features of each symptom mention node at each layer according to the order of their appearance in the compressed structured dialogue sequence to obtain the final node representation sequence. S322. For each slot type in the predefined endometriosis symptom slots, read the ontology type of the slot type in the endometriosis knowledge graph, and determine the corresponding set of candidate center nodes based on the ontology type. S323. Based on the ontology type corresponding to the slot type, select nodes to participate in pooling from the candidate center node and the causal neighborhood of the candidate center node, and perform the pooling operation corresponding to the slot type on the final node features of the corresponding nodes to obtain the slot-specific graph context representation.
8. The method for filling symptom slots related to endometriosis in multi-round consultation dialogues according to claim 1, characterized in that, The process involves fusing the slot-specific graph context representation with the slot type embedding in the predefined endogenous symptom slots and the global dialogue intent vector to generate an intent-aware query vector and predict the start and end positions of slot filling. Based on the start and end positions of all slots, joint loss optimization is performed by fusing symptom causal chain distribution alignment to obtain the trained slot filling model, which includes: S41. Generate an intent-aware query vector for each slot type in the current consultation context, and match the intent-aware query vector with each node in the final node representation sequence to obtain the probability distribution of the slot filling start position and the probability distribution of the end position. S42. The sum of the negative log-likelihood loss at the start position and the negative log-likelihood loss at the end position for all slot types is used as the main loss. The distance between the node attention distributions of slot pairs with direct pathological causal relationships is used as the regularization term. The main loss and the regularization term are weighted and combined to obtain the joint loss function. The joint loss function is used as the training objective to optimize the model and obtain the trained slot filling model.
9. The method for filling symptom slots related to endometriosis in multi-round consultation dialogues according to claim 8, characterized in that, The process of generating an intent-aware query vector for each slot type in the current consultation context, and matching the intent-aware query vector with each node in the final node representation sequence to obtain the probability distribution of the slot filling start position and the probability distribution of the end position includes: S411. Set a learnable slot type embedding for each slot type in the predefined endometriosis symptom slots to encode the fixed semantics of the slot type; S412. The slot type embedding, global dialogue intent vector and slot-specific graph context representation are concatenated along the feature dimension, and affine transformation and layer normalization are performed in sequence to obtain the intent-aware query vector of the slot type in the current consultation dialogue. S413. Set learnable empty node features outside the final node representation sequence, and concatenate the empty node features with the final node representation sequence along the node dimension to obtain the extended node representation sequence. S414. For each candidate position in the extended node representation sequence, use a preset number of pointer attention heads to calculate the score of the candidate position as the starting position for slot type filling; S415. After normalizing the start position scores of all candidate positions, take the one with the highest probability as the prediction start index, and after normalizing the end position scores of all candidate positions, take the one with the highest probability as the prediction end index. S416. When both the prediction start index and the prediction end index point to a node, restore the slot fill value according to the original text position stored in that node; otherwise, determine the slot fill result as empty.
10. The method for filling symptom slots related to endometriosis in multi-round consultation dialogues according to claim 8, characterized in that, The main loss is obtained by summing the negative log-likelihood loss at the start position and the negative log-likelihood loss at the end position for all slot types. A regularization term is used, with the node attention distribution distance between slot pairs with a direct pathological causal relationship as the regularization term. The main loss and regularization term are weighted and combined to obtain a joint loss function. This joint loss function is then used as the training objective for model optimization, resulting in the trained slot-filling model, which includes: S421. Read the manually labeled true start position index and true end position index for each slot type, and read the predicted probability of the corresponding position from the probability distribution of the slot filling start position and the probability distribution of the slot filling end position, respectively. S422. Read the direct pathological causal relationships between slot entities from the endometriosis knowledge graph and establish a set of causal slot pairs. S423. For each slot type, calculate the attention distribution vector of that slot type on each symptom mention node based on the scores of each attention head to the node in the multi-head pointer attention mechanism. S424. For each slot pair in the causal slot pair set, calculate the distance between the attention distribution vectors of the two slot types and sum them to obtain the symptom causal chain distribution alignment regularization term; S425. The sum of the start position loss and end position loss of all slot types is weighted and combined with the regularization term to obtain the joint loss function; S426. Using the joint loss function as the model training objective, update the parameters involved in training, the orientation decoupling graph encoder parameters, the slot type embedding, the empty node features, the multi-head pointer attention parameters, and the query fusion parameters in the biomedical pre-trained language model through backpropagation. After each training cycle, use the validation set to calculate the slot-level precision, slot-level recall, and slot-level F1 score, and save the model parameters corresponding to the highest slot-level F1 score in the validation set to obtain the trained slot-filling model.
