A traditional chinese medicine inquiry symptom semantic fuzzy guidance matching method and system
By establishing semantic anchor inverted indexes and attribution inverted indexes, semantic ambiguity in colloquial symptom text in TCM consultation systems is addressed, a candidate resource set is generated, and confirmation information is filtered out. This solves the problems of low retrieval efficiency and accuracy caused by semantic ambiguity in TCM consultation systems, achieving more efficient and reliable resource matching.
Patent Information
- Application Number
- CN202611289199.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-24
- Publication Date
- 2026-11-06
AI Technical Summary
Existing TCM consultation systems suffer from semantic ambiguity when processing colloquial symptom texts, resulting in low retrieval efficiency, inaccurate results, and difficulty in effectively matching resources.
By extracting semantic anchors, modifying semantic fragments and result category identifiers, a semantic anchor inverted index and affiliation inverted index are established to generate a semantic relationship index. Ambiguity is handled by using confirmed and unconfirmed semantic connections, a candidate resource set is generated and confirmation information is filtered to improve matching accuracy.
It improves the ability to handle semantic ambiguity, reduces duplicate searches, enhances the reliability and rationality of matching results, and improves the search efficiency and accuracy of the TCM consultation system.
Smart Images

Figure CN123048686A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of information retrieval and natural language processing, specifically to a method and system for semantically ambiguous diagnosis matching of symptoms in traditional Chinese medicine consultations. Background Technology
[0002] As the digitization of TCM consultation resources continues to improve, symptom databases, historical consultation texts, specialist information, and related service resources are gradually forming searchable text resources. User-inputted symptom texts are often colloquial, non-standardized, and contain many synonyms, requiring natural language processing and information retrieval technologies to match symptom expressions with resource data.
[0003] Existing semantic retrieval methods typically employ keyword retrieval, synonym expansion, or semantic similarity matching to identify symptom information. When the same statement contains multiple symptoms and the time, severity, cause, or negative modifiers lack clear direction, the attribution relationship between the modifiers and the symptoms may be ambiguous, thus affecting the candidate resource selection results. Furthermore, performing separate searches for different semantic attributions may increase duplicate searches and interactive processing.
[0004] Therefore, it is necessary to further improve the ability to handle semantic attribution ambiguity in colloquial symptom texts, reduce the impact of incorrect attribution on resource matching results while maintaining retrieval efficiency, and improve the accuracy and interpretability of the resource retrieval matching process. Summary of the Invention
[0005] Based on the shortcomings of the prior art described above, the purpose of this invention is to provide a method and system for semantically ambiguous diagnosis matching of symptoms in traditional Chinese medicine consultation, so as to solve the above-mentioned technical problems.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for semantically ambiguous symptom-based diagnostic matching in traditional Chinese medicine consultation, comprising: S1: Extract semantic anchors, modify semantic fragments, result category identifiers and resource identifiers from text resource data, establish a record with clear semantic attribution, establish a semantic anchor inverted index with semantic anchors as index items, establish a semantic attribution inverted index based on the record with clear semantic attribution, and associate the result category identifier with the resource identifier to generate a semantic relationship index; S2: Obtain the semantic anchors and modifying semantic fragments from the text to be retrieved. Establish confirmed semantic connections between the clearly attributed modifying semantic fragments and their corresponding semantic anchors. Keep the unattributed modifying semantic fragments as single dangling semantic nodes and establish unconfirmed semantic connections with multiple semantically compatible semantic anchors. Generate a semantic relationship graph and a semantic anchor query set. S3: Perform a single basic search on the semantic anchor inverted index based on the semantic anchor query set, determine the search results as a candidate resource set and write them to the cache, query the semantic attribution inverted index based on the semantic join to be confirmed, generate the attribution mask of the candidate resources, form candidate resource groups according to the attribution mask and the result category identifier, determine the candidate resource groups with different attribution masks and the same result category identifier as category-independent ambiguity, and generate category conflict data packets for candidate resource groups with different attribution masks and different result category identifiers; S4: When there are no category conflict data packets, the candidate resources are grouped and merged to obtain the target resource set; when there are category conflict data packets, a connection confirmation item is generated and confirmation information is obtained. When the confirmation information indicates a clear attribution, the target semantic connection is determined and the cached candidate resource set is filtered using the target semantic connection to obtain the target resource set; when the confirmation information indicates an uncertain attribution, the target resource set is obtained by grouping the retained candidate resources; and resource retrieval matching results are generated based on the target resource set and the semantic relationship graph.
[0007] The present invention is further configured such that generating a semantic relation index includes: Extract resource identifiers, semantic anchors, modified semantic fragments, modified relation types, result category identifiers, original text fragments, and original text evidence locations from text resource data; Determine the attribution relationship between semantic anchors and modifying semantic fragments. For relationships with clear attribution, generate a clear semantic attribution record containing the semantic anchor, modifying semantic fragment, modification relationship type, and resource identifier. For relationships with unclear attribution, do not generate a clear semantic attribution record. A semantic anchor inverted index is built based on semantic anchors, a semantic attribution inverted index is built based on records with explicit semantic attribution, a relationship between result category identifiers and resource identifiers is established, and the original text fragments and original text evidence locations are associated with the corresponding records with explicit semantic attribution, thus generating a semantic relationship index.
[0008] The present invention is further configured such that establishing a confirmed semantic connection includes: The attribution relationship is determined based on the textual position and pre-defined relational markers between semantic anchors and modifying semantic fragments. When the attribution relationship of a modified semantic fragment is compatible with only one semantic anchor, or when the relation marker explicitly points to a semantic anchor, a confirmed semantic connection is established between the modified semantic fragment and the corresponding semantic anchor.
[0009] The present invention is further configured such that retaining it as a single dangling semantic node and establishing a semantic connection to be confirmed includes: When there are multiple semantic anchors within the same sentence range of the text to be retrieved, and the modifying semantic fragment lacks a clear attribution, the modifying semantic fragment will be retained as a single dangling semantic node. Each dangling semantic node is connected to a semantically compatible semantic anchor, a connection identifier is assigned to each connection, a semantic connection to be confirmed is generated, and the dangling semantic node is kept from being copied.
[0010] The present invention is further configured such that generating the semantic relationship graph and semantic anchor query set includes: Generate a semantic relationship graph by associating semantic anchors, clearly defined semantic fragments, confirmed semantic connections, single dangling semantic nodes, and semantic connections to be confirmed. Extract semantic anchors from the semantic relationship graph and remove duplicates to generate a semantic anchor query set.
[0011] The present invention is further configured such that performing a single basic search and obtaining a candidate resource set includes: Based on the semantic anchor query set, query the inverted index of semantic anchors, obtain the resource identifiers corresponding to the semantic anchors, and record the semantic anchors covered by each resource identifier; A candidate resource set is generated based on the resource identifier and written to the cache. Basic retrieval does not currently handle the attribution determination of a single dangling semantic node.
[0012] The present invention is further configured such that generating the attribution mask and forming candidate resource groups includes: For a single dangling semantic node, the semantic attribution inverted index is queried based on each unconfirmed semantic connection corresponding to the single dangling semantic node to obtain the resource identifier corresponding to each unconfirmed semantic connection. Match the resource identifiers corresponding to each semantic connection to be confirmed with the resource identifiers in the candidate resource set. Record the support status of each candidate resource for each semantic connection to be confirmed according to the recording order of each semantic connection to be confirmed in the semantic relationship graph, and generate the ownership mask of each candidate resource. Candidate resources are grouped based on their attribution mask and result category identifier. Candidate resources with different attribution masks but the same result category identifier are grouped as category-independent ambiguity, while candidate resources with different attribution masks and different result category identifiers are grouped to generate category conflict data packets.
[0013] The present invention is further configured such that, when there are no class conflict data packets, generating the target resource set includes: When there are no conflicting data packets, the candidate resources are grouped and combined to obtain the target resource set; For candidate resource groups identified as category-independent ambiguity, retain the corresponding single dangling semantic node and do not generate connection confirmation items.
[0014] The present invention is further configured such that, when class conflict data packets exist, generating the target resource set includes: When there are class conflict packets, extract a single dangling semantic node, a semantically compatible semantic anchor, and a semantic connection to be confirmed from the class conflict packets, generate a connection confirmation item, associate each confirmation option in the connection confirmation item with one or more semantic connections to be confirmed, output the connection confirmation item and obtain confirmation information; When the information representation clearly indicates the attribution, determine one or more corresponding target semantic links, filter the cached candidate resource set according to the attribution mask corresponding to the target semantic link, retain the candidate resources that support all target semantic links, and form a target resource set; When the attribution of the confirmed information is uncertain, the candidate resource groups corresponding to the category conflict data packets are retained. The target resource set is formed based on the retained candidate resource groups and marked as semantically unconfirmed. When the filtering result of the candidate resource set is empty, the cached candidate resource set is restored to the target resource set, and the semantic relationship evidence is marked as insufficient; Resource retrieval matching results are generated based on the target resource set and semantic relationship graph.
[0015] This invention also provides a semantically ambiguous diagnostic matching system for symptoms in traditional Chinese medicine consultations, the system comprising: Semantic index building module: Extracts semantic anchors, modifies semantic fragments, result category identifiers and resource identifiers from text resource data, establishes records with clear semantic attribution, builds inverted indexes with semantic anchors as index items, builds inverted indexes with semantic attribution based on records with clear semantic attribution, and associates result category identifiers with resource identifiers to generate a semantic relationship index; Hanging Node Generation Module: Obtain the text to be retrieved, extract semantic anchors and modifying semantic fragments, establish confirmed semantic connections between clearly attributed modifying semantic fragments and corresponding semantic anchors, retain unattributed modifying semantic fragments as single hanging semantic nodes and establish unconfirmed semantic connections with multiple semantically compatible semantic anchors, and generate a semantic relationship graph and a semantic anchor query set. Attribution determination and grouping module: Based on the semantic anchor query set, a single basic search is performed on the semantic anchor inverted index. The search results are determined as a candidate resource set and written to the cache. Based on the semantic connection to be confirmed, the semantic attribution inverted index is queried to generate the attribution mask of the candidate resources. The candidate resources are grouped according to the attribution mask and the result category identifier. Candidate resource groups with different attribution masks and the same result category identifier are determined as category-independent ambiguity. Candidate resource groups with different attribution masks and different result category identifiers are generated into category conflict data packets. Matching result output module: When there are no category conflict data packets, the candidate resources are grouped and merged to obtain the target resource set; when there are category conflict data packets, a connection confirmation item is generated and confirmation information is obtained. When the confirmation information indicates a clear attribution, the target semantic connection is determined and the cached candidate resource set is filtered using the target semantic connection to obtain the target resource set; when the confirmation information indicates an uncertain attribution, the target resource set is obtained by grouping the retained candidate resources; and resource retrieval matching results are generated based on the target resource set and the semantic relationship graph.
[0016] This invention provides a method and system for semantically ambiguous symptom-based diagnosis matching in Traditional Chinese Medicine (TCM) consultations. The method comprises: S1: Extracting semantic anchors, modified semantic fragments, result category identifiers, and resource identifiers from text resource data; establishing records with clear semantic attribution; building an inverted index of semantic anchors using semantic anchors as index terms; building an inverted index of semantic attribution based on records with clear semantic attribution; associating result category identifiers with resource identifiers; generating a semantic relationship index; S2: Obtaining the text to be retrieved, extracting semantic anchors and modified semantic fragments; establishing confirmed semantic connections between clearly attributed modified semantic fragments and their corresponding semantic anchors; retaining modified semantic fragments with unclear attribution as single dangling semantic nodes and establishing unconfirmed semantic connections with multiple semantically compatible semantic anchors; generating a semantic relationship graph and a semantic anchor query set; S3: Performing a single basic search on the inverted index of semantic anchors based on the semantic anchor query set; and determining the search results as candidate resources. The process involves: S1) Collecting and writing the data into a cache; 2) Querying the semantic attribution inverted index based on the semantic connections to be confirmed; 3) Generating attribution masks for candidate resources; 4) Forming candidate resource groups based on the attribution masks and result category identifiers; 5) Determining candidate resource groups with different attribution masks but the same result category identifier as category-independent ambiguity; and 6) Generating category conflict data packets for candidate resource groups with different attribution masks and different result category identifiers. S7) If no category conflict data packets exist, the candidate resource groups are merged to obtain the target resource set. If category conflict data packets exist, connection confirmation items are generated and confirmation information is obtained. If the confirmation information indicates a clear attribution, the target semantic connection is determined, and the cached candidate resource set is filtered using the target semantic connection to obtain the target resource set. If the confirmation information indicates an uncertain attribution, the target resource set is obtained based on the retained candidate resource groups. Finally, resource retrieval matching results are generated based on the target resource set and the semantic relationship graph. The beneficial effects include: Improve semantic ambiguity handling capabilities: By using a single suspended semantic node to retain modified semantic fragments with unclear attribution, and establishing unconfirmed semantic connections with multiple semantically compatible semantic anchors, the matching bias caused by semantic node duplication and premature attribution determination is reduced.
[0017] Improve retrieval processing efficiency: By performing a single basic retrieval, candidate resource caching, and attribution masking, cached resources are directly filtered after semantic confirmation, reducing duplicate retrievals caused by semantic attribution branches.
[0018] Enhancing the reliability of matching results: By distinguishing between category-irrelevant ambiguity and category conflict, connection confirmation is only performed on semantic ambiguities that may affect resource categories, which helps reduce unnecessary confirmation operations and improves the rationality and interpretability of matching results.
[0019] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings: Figure 1 A flowchart illustrating a semantically ambiguous symptom-based triage matching method in traditional Chinese medicine consultation, as shown in an exemplary embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the structure of a semantically ambiguous triage matching system for symptoms in traditional Chinese medicine consultation, as shown in an exemplary embodiment of the present invention. Detailed Implementation
[0021] The embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the scope of protection of the present invention.
[0022] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0023] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.
[0024] Example 1: A semantically ambiguous symptom-based triage matching method in Traditional Chinese Medicine (TCM) consultation, such as... Figure 1 As shown, it includes: S1: Extract semantic anchors, modify semantic fragments, result category identifiers and resource identifiers from text resource data, establish a record with clear semantic attribution, establish a semantic anchor inverted index with semantic anchors as index items, establish a semantic attribution inverted index based on the record with clear semantic attribution, and associate the result category identifier with the resource identifier to generate a semantic relationship index; S2: Obtain the semantic anchors and modifying semantic fragments from the text to be retrieved. Establish confirmed semantic connections between the clearly attributed modifying semantic fragments and their corresponding semantic anchors. Keep the unattributed modifying semantic fragments as single dangling semantic nodes and establish unconfirmed semantic connections with multiple semantically compatible semantic anchors. Generate a semantic relationship graph and a semantic anchor query set. S3: Perform a single basic search on the semantic anchor inverted index based on the semantic anchor query set, determine the search results as a candidate resource set and write them to the cache, query the semantic attribution inverted index based on the semantic join to be confirmed, generate the attribution mask of the candidate resources, form candidate resource groups according to the attribution mask and the result category identifier, determine the candidate resource groups with different attribution masks and the same result category identifier as category-independent ambiguity, and generate category conflict data packets for candidate resource groups with different attribution masks and different result category identifiers; S4: When there are no category conflict data packets, the candidate resources are grouped and merged to obtain the target resource set; when there are category conflict data packets, a connection confirmation item is generated and confirmation information is obtained. When the confirmation information indicates a clear attribution, the target semantic connection is determined and the cached candidate resource set is filtered using the target semantic connection to obtain the target resource set; when the confirmation information indicates an uncertain attribution, the target resource set is obtained by grouping the retained candidate resources; and resource retrieval matching results are generated based on the target resource set and the semantic relationship graph.
[0025] The present invention is further configured such that generating a semantic relation index includes: Extract resource identifiers, semantic anchors, modified semantic fragments, modified relation types, result category identifiers, original text fragments, and original text evidence locations from text resource data; Determine the attribution relationship between semantic anchors and modifying semantic fragments. For relationships with clear attribution, generate a clear semantic attribution record containing the semantic anchor, modifying semantic fragment, modification relationship type, and resource identifier. For relationships with unclear attribution, do not generate a clear semantic attribution record. Establish a semantic anchor inverted index based on semantic anchors, establish a semantic attribution inverted index based on explicit semantic attribution records, establish associations between result category identifiers and resource identifiers, and associate original text fragments and original text evidence positions to corresponding explicit semantic attribution records to generate a semantic relationship index. Specifically, the text resource data includes the standard traditional Chinese medicine symptom lexicon, symptom synonymous expression library, disease and symptom knowledge graph, specialized disease and specialty data, department data, physician expertise labels, historical medical record texts, and desensitized consultation records. Structured data is read through a database interface, and document data is converted into plain text via a document parsing component, followed by character encoding normalization, traditional-simplified character conversion, punctuation unification, sentence segmentation, and whitespace cleaning; the resource identifier consists of a source type code and a unique serial number within the source, a semantic anchor refers to a standard symptom semantic unit composed of body part semantics and sensation semantics, a modified semantic fragment refers to a text fragment that limits the occurrence time, inducement, degree, or negation state, modification relationship types include time attribution, inducement attribution, degree attribution, and negation attribution, a result category identifier refers to the specialized disease, specialty, department, or physician expertise category associated with the resource, each result category identifier corresponds to a complete resource classification path, when one resource is associated with multiple resource classification paths, association records between the resource identifier and each result category identifier are established respectively, candidate resource groups are formed according to the result category identifiers in the association records, the target resource set is deduplicated by resource identifier, and the original text evidence position records the source field, sentence serial number, and start and end character serial numbers; the IK Chinese tokenizer and the domain dictionary longest matching method are used to extract semantic anchors and modified semantic fragments, text fragments that do not hit standard words and have a length of no less than 2 characters are subjected to 2-gram tokenization with consecutive 2 characters, the lower length limit is set to 2 characters because 2-gram tokenization requires at least 2 consecutive characters, for example, "wei du" (stomach stuffiness) can form one 2-gram character fragment, the single character "tong" (pain) does not undergo 2-gram tokenization and continues to be matched according to the domain dictionary, then the standard expression is confirmed through the symptom synonymous expression library or the disease and symptom knowledge graph, for example, mapping "wei li fa du" (stuffiness in the stomach) to "bu wei — fa du" (stomach part — stuffiness), mapping "xiong kou men" (chest stuffiness) to "xiong bu — fa men" (chest part — stuffiness), and mapping "wan shang" (evening) to "ye jian" (night); the semantic attribution relationship is determined based on structured labels, text positions, preset relationship markers, and HanLP dependency parsing results, the preset relationship markers include "at the time of...", "after eating", "after catching cold", "more obvious", "no", and "deny", when there is only one semantically compatible semantic anchor in the same sentence, or when the relationship marker and the dependency parsing result uniquely point to one semantic anchor, an explicit semantic attribution record containing the resource identifier, semantic anchor identifier, modified semantic fragment identifier, modification relationship type, result category identifier, and original text evidence position is generated, and when there are multiple semantically compatible semantic anchors and the unique attribution cannot be determined, no explicit semantic attribution record is generated;Employing the Lucene inverted index mechanism of the Elasticsearch search engine, semantic anchor identifiers and their corresponding resource identifiers are written into the semantic anchor inverted index. Semantic attribution index items composed of semantic anchor identifiers, modifying semantic fragment identifiers, and modifying relation types are written into the semantic attribution inverted index along with resource identifiers and explicit semantic attribution record identifiers. Associations are established between resource identifiers and result category identifiers, and between explicit semantic attribution record identifiers and the original text evidence locations. A list of frequently accessed resource identifiers is written into a Redis collection structure. For example, resource identifier R001 corresponds to "stomach congestion occurs at night" and is associated with result category identifier C01; resource identifier R002 corresponds to "chest tightness occurs at night" and is associated with result category identifier C02; resource identifier R003 corresponds to "stomach congestion and chest tightness occur at night" and is associated with result category identifier C03. Standardization processing yields semantic anchor A001 "stomach congestion" and semantic anchor... For point A002 "chest tightness" and the modifying semantic fragment M001 "night," resource identifier R001 generates a clear semantic attribution record G001 between A001 and M001, resource identifier R002 generates a clear semantic attribution record G002 between A002 and M001, and resource identifier R003 does not generate a clear semantic attribution record because M001 lacks a unique attribution. This ultimately forms a semantic anchor inverted index for A001 associated with resource identifiers R001 and R003, and A002 associated with resource identifiers R002 and R003, as well as a semantic attribution inverted index for the time attribution of A001 to M001 associated with resource identifier R001, and the time attribution of A002 to M001 associated with resource identifier R002. It also forms association records between resource identifier R001 and result category identifier C01, resource identifier R002 and result category identifier C02, and resource identifier R003 and result category identifier C03.
[0026] The present invention is further configured such that establishing a confirmed semantic connection includes: The attribution relationship is determined based on the textual position and pre-defined relational markers between semantic anchors and modifying semantic fragments. When the attribution relationship of a modified semantic segment is only compatible with one semantic anchor, or the relationship marker clearly points to one semantic anchor, a confirmed semantic connection is established between the modified semantic segment and the corresponding semantic anchor. Specifically, based on the semantic relationship index generated in the previous embodiment, the text to be retrieved is acquired, and the previous text standardization, synonymous expression mapping and standard word conversion rules are followed to extract semantic anchors and modified semantic segments, while recording the sentence number, start character number and end character number to form a text position. The relationship marker configuration data pre-records the relationship marker content, modification relationship type, pointing direction and action boundary. The relationship marker content includes "when...", "once...", "after eating", "after catching cold", "more obvious", "no" and "deny". For example, "once at night" matches the relationship marker "once...". The pointing direction includes the backward pointing that preferentially connects the subsequent semantic anchor and the forward pointing that preferentially connects the preceding semantic anchor. The sentence segmentation result determines the sentence scope, and periods, semicolons, question marks and exclamation marks are set as non-traversable strong boundaries. Commas are set as weak boundaries, which do not directly cut off the semantic action scope. Combined with coordinating conjunctions such as "also", "and", "simultaneously" or "and", relationship markers and dependency parsing results, it is determined whether the semantic anchors before and after the comma are located in the same semantic action scope, and the fixed character distance threshold is no longer used to divide the semantic action scope. The relationship marker configuration data is used to match the modification relationship type, pointing direction and semantic action scope of each modified semantic segment, semantic anchors are extracted from the semantic action scope, and candidate semantic anchors with semantic compatibility are determined according to the semantic anchor type, modification relationship type, symptom synonymous expression library and disease knowledge graph. The semantic attribution inverted index does not participate in the unique attribution determination in the current step, and the semantic attribution inverted index is reserved for query during the delayed attribution processing on the candidate resource side. The HanLP dependency parsing component is used to identify the head word corresponding to the modified semantic segment and associate the semantic anchor containing the head word. The attribution relationship is determined when the candidate semantic anchor set contains only one semantic anchor, and the attribution relationship is also determined when the candidate semantic anchor set contains multiple semantic anchors but the relationship marker and the dependency parsing result jointly point to one semantic anchor. When the relationship marker conflicts with the dependency parsing result or the unique semantic anchor cannot be determined, no confirmed semantic connection is established. After the attribution relationship is determined, the Snowflake algorithm is used to generate a connection identifier, and a confirmed semantic connection is established between the modified semantic segment and the corresponding semantic anchor. The confirmed semantic connection records the connection identifier, semantic anchor identifier, modified semantic segment identifier, modification relationship type, text positions of both parties and confirmed status. Take the text to be retrieved as "Feeling stuffy in the stomach after eating, also feeling tight in the chest, which occurs at night." is a complete processing example, where "after eating" corresponding to characters 0 to 2 is identified as the modified semantic fragment M002, "stomach fullness and blockage" corresponding to characters 3 to 6 is mapped to the semantic anchor A001 "stomach - blockage", "chest is also stuffy" corresponding to characters 8 to 11 is mapped to the semantic anchor A002 "chest - stuffiness", and "evening" corresponding to characters 13 to 14 is mapped to the modified semantic fragment M001 "nighttime"; the relation labeling configuration data identifies "after eating" as a backward-pointing inducement relation label, the HanLP dependency parsing result indicates that "after eating" modifies "blockage", and the candidate semantic anchor set of the modified semantic fragment M002 only contains the semantic anchor A001, so the confirmed semantic connection E001 is generated; the word "also" in the to-be-retrieved text indicates that the semantic anchor A001 and the semantic anchor A002 form a parallel semantic structure, but the modified semantic fragment M002 is limited by the backward-pointing relation label and the dependency parsing result, and only belongs to the semantic anchor A001; the modified semantic fragment M001 located after the parallel semantic structure is a time-modified semantic fragment, both the semantic anchor A001 and the semantic anchor A002 are compatible with the time attribution relation, and "appears in the evening" at the end of the sentence lacks a unique pointing relation, so no confirmed semantic connection is established for the modified semantic fragment M001, and finally the confirmed semantic connection E001 and the candidate semantic anchor set corresponding to the modified semantic fragment M001 are output, which provides input for the subsequent establishment of a single hanging semantic node and a to-be-confirmed semantic connection.
[0027] The present invention is further configured such that retaining as a single hanging semantic node and establishing a to-be-confirmed semantic connection includes: When multiple semantic anchors exist within the same statement range of the to-be-retrieved text and the modified semantic fragment lacks a clear attribution, the modified semantic fragment is retained as a single hanging semantic node; Each dangling semantic node is connected to a semantically compatible semantic anchor, a connection identifier is assigned to each connection, a semantic connection to be confirmed is generated, and the dangling semantic node is kept from being copied. Specifically, the system receives semantic anchors, modified semantic fragments, confirmed semantic connections, and a set of candidate semantic anchors whose unique attribution cannot be determined from the output of the preceding processing. It uses the statement range, text position, modification relation type, and semantic compatibility results determined by the preceding processing. When the candidate semantic anchor set contains only one semantic anchor, a confirmed semantic connection is established. When the candidate semantic anchor set contains two or more semantic anchors, and the text position, relation markers, and dependency parsing results cannot determine a unique attribution, the modified semantic fragment is retained as a single dangling semantic node. The node unique key is formed by sequentially concatenating the consultation round identifier, statement sequence number, node type identifier, start character sequence number, and end character sequence number. Node type identifier 01 represents a semantic anchor, node type identifier 02 represents a clearly attributed modified semantic fragment, and node type identifier 03 represents a single dangling semantic node. A hash mapping table is used to query the node unique key. If no matching node unique key is found, a snowflake algorithm is used to generate a dangling node identifier and establish a single dangling semantic node. If a matching node unique key is found, the already established node is directly reused. A single suspended semantic node is used to ensure that only one single suspended semantic node is retained for the same consultation round, the same statement, and the same text position. The single suspended semantic node records the suspended node identifier, node unique key, original expression, normalized expression, modification relationship type, text position, candidate semantic anchor set, and suspended state. Candidate semantic anchors are arranged according to the order of appearance in the text to be retrieved. When the text positions are the same, they are arranged according to the semantic anchor identifier. The connection order is recorded continuously starting from 1. Then, the snowflake algorithm is used to generate connection identifiers for the connection between the single suspended semantic node and each candidate semantic anchor, forming a semantic connection to be confirmed that records the suspended node identifier, semantic anchor identifier, modification relationship type, connection order, and pending confirmation state. An adjacency list is used to store the relationship between the single suspended semantic node, semantic anchor, and pending confirmation semantic connection. The adjacency list is cached using a Redis hash structure. Subsequent processing directly reads the adjacency list without copying the modified semantic fragment, semantic anchor, or complete semantic relationship graph. The previous text to be retrieved was "My stomach feels blocked and my chest feels tight after eating, which occurs at night."For a complete processing example, the preceding processing has generated semantic anchor A001 "stomach - congestion", semantic anchor A002 "chest - stuffiness", modifying semantic fragment M001 "night", and confirmed semantic connection E001. Modifying semantic fragment M001 is located between characters 13 and 14. Both semantic anchors A001 and A002 are semantically compatible with modifying semantic fragment M001, and the preceding processing cannot determine a unique attribution. Therefore, a unique node key "Q001-S001-" is generated according to the consultation round identifier Q001, statement sequence number S001, node type identifier 03, start character sequence number 13, and end character sequence number 14. "03-13-14", establish a single dangling semantic node H001, and then establish a semantic connection to be confirmed E002 with connection order 1 and a semantic connection to be confirmed E003 with connection order 2 according to the text appearance order of semantic anchors A001 and A002. The adjacency list records the association between the single dangling semantic node H001 and the semantic connection to be confirmed E002 and E003. Finally, output the single dangling semantic node H001, the semantic connection to be confirmed E002, the semantic connection to be confirmed E003 and the updated adjacency list, which provides input for the subsequent generation of semantic relationship graph, semantic anchor query set and attribution mask.
[0028] The present invention is further configured such that generating the semantic relationship graph and semantic anchor query set includes: Generate a semantic relationship graph by associating semantic anchors, clearly defined semantic fragments, confirmed semantic connections, single dangling semantic nodes, and semantic connections to be confirmed. Semantic anchors are extracted from the semantic relationship graph and deduplicated to generate a semantic anchor query set. Specifically, the semantic anchors, clearly attributed modifying semantic fragments, confirmed semantic connections, single dangling semantic nodes, and unconfirmed semantic connections output from previous steps are received, and a semantic relationship graph is constructed using an adjacency list data structure. The semantic relationship graph includes a node record table, a connection record table, and an adjacency list. The node record table stores the node type, standard expression, original expression, and text position, with the text position using a start character index and an end character index starting from 0. The connection record table stores the connection identifier, start node, target node, modifying relationship type, connection order, and connection status, including confirmed and unconfirmed states. The adjacency list associates the connection identifier with the node's unique key. Semantic anchors and clearly attributed modifying semantic fragments generate unique node keys according to the consultation round identifier, statement number, node type identifier, start character index, and end character index, respectively. Single dangling semantic nodes use the dangling node identifier generated in the previous step, and nodes are not created again for source modifying semantic fragments. A hash mapping table is used to sequentially write semantic anchors, clearly defined semantic fragments, and single dangling semantic nodes. Then, connection records are written based on confirmed and pending semantic connections. Pending semantic connections are numbered consecutively from 1 according to the order of appearance of the associated semantic anchors in the text to be retrieved, and arranged according to the semantic anchor identifier when the text positions are the same. The node record table, connection record table, and adjacency table are written into a Redis hash structure according to the round-of-diagnosis identifier. When generating the semantic anchor query set, all semantic anchors in the semantic relationship graph are traversed according to their initial text position. An ordered hash set is used to deduplicate the semantic anchor identifiers, ensuring that all semantic anchors associated with confirmed and pending semantic connections are included in the semantic anchor query set. When the same semantic anchor appears repeatedly in different text positions, the semantic relationship graph retains each text position, but the semantic anchor query set retains only one semantic anchor identifier. This step does not set a similarity threshold and directly uses the semantic compatibility results output from the previous steps. The complete processing is as follows: The text to be retrieved is "My stomach feels blocked and my chest feels tight after eating, especially at night.""After the preceding steps, semantic anchor A001 "stomach - congestion", semantic anchor A002 "chest - stuffiness", clearly attributed modifying semantic fragment M002 "after eating", confirmed semantic connection E001, single dangling semantic node H001, unconfirmed semantic connection E002, and unconfirmed semantic connection E003 are generated. Sequentially, semantic anchor A001, semantic anchor A002, clearly attributed modifying semantic fragment M002, and single dangling semantic node H001 are written. Confirmed semantic connection E001 connecting M002 and A001, unconfirmed semantic connection E002 connecting H001 and A001, and unconfirmed semantic connection E003 connecting H001 and A002 are written, forming a semantic relationship graph containing 4 nodes and 3 semantic connections. Then, semantic anchor A001 and semantic anchor A002 are extracted and deduplicated to generate a semantic anchor query set containing semantic anchor A001 and semantic anchor A002."
[0029] The present invention is further configured such that performing a single basic search and obtaining a candidate resource set includes: Based on the semantic anchor query set, query the inverted index of semantic anchors, obtain the resource identifiers corresponding to the semantic anchors, and record the semantic anchors covered by each resource identifier; A candidate resource set is generated based on the resource identifier and written to the cache. Basic retrieval does not currently handle the attribution determination of a single dangling semantic node. Specifically, the semantic relationship graph and semantic anchor query set generated in the previous steps are received. Using the Elasticsearch Boolean retrieval algorithm, each semantic anchor in the semantic anchor query set is converted into a precise query condition for the semantic anchor identifier field. A corresponding semantic anchor identifier is configured for each precise query condition. Then, all precise query conditions are written to the same retrieval request. The minimum hit count is set to 1 by default, ensuring that resources with at least one semantic anchor hit enter the candidate resource set. When the semantic anchor query set contains only one semantic anchor, the minimum hit count is still set to 1. When the semantic anchor query set contains multiple semantic anchors, the minimum hit count is also kept at 1 to retain resources that only cover some semantic anchors but have clear semantic attribution records. For example, when the semantic anchor query set contains semantic anchors A001 and A002, resources that hit semantic anchors A001 or A002 respectively enter the candidate resource set. The system reads resource identifiers and exact query condition hit results from the retrieval response. It records semantic anchor coverage relationships according to the semantic anchor identifiers carried by the exact query conditions. The semantic anchor coverage relationship represents the actual semantic anchor hit for each resource identifier. After deduplicating the resource identifiers, a candidate resource set is generated and written to a Redis set structure. The semantic anchor coverage relationship is written to a Redis hash structure. The cache key is composed of the query round identifier and the data type identifier. For example, if the query round identifier is Q001 and the data type identifier is CANDIDATE_SET, the cache key is "Q001-CANDIDATE_SET". The system caches configuration data packages. This includes the maximum wait time for connection confirmation, ranging from 5 to 60 minutes, with a default of 20 minutes; and the cache validity period, which defaults to 30 minutes, also ranging from 5 to 60 minutes and not shorter than the maximum wait time for connection confirmation. For example, if the maximum wait time for connection confirmation is set to 20 minutes, the default cache validity period is 30 minutes; if the maximum wait time for connection confirmation is set to 45 minutes, the cache validity period is set to 45 minutes. When obtaining connection confirmation information, the cache validity period is reset according to the same rules. After generating resource retrieval matching results, the cache is deleted. If no connection confirmation information is obtained within the cache validity period, the cache is automatically cleared. A single basic search only queries the semantic anchor inverted index, not the semantic attribution inverted index, and does not determine the attribution of a single dangling semantic node. Confirmed semantic connections in the semantic relationship graph are retained, while single dangling semantic nodes and unconfirmed semantic connections are not included in the search conditions.Taking the semantic anchors A001 ("stomach - congestion") and A002 ("chest - stuffiness") generated in the previous steps as examples, the inverted index of semantic anchors records that semantic anchor A001 is associated with resource identifiers R001 and R003, and semantic anchor A002 is associated with resource identifiers R002 and R003. The processing program writes semantic anchors A001 and A002 into the same search request and performs one search, obtaining semantic anchor A001 corresponding to resource identifier R001 and semantic anchor A002 corresponding to resource identifier R003. Resource identifiers R002 and R003 correspond to semantic anchors A001 and A002, thus generating a candidate resource set containing resource identifiers R001, R002, and R003. The corresponding semantic anchor coverage relationships are recorded and written to the Redis cache according to the query round identifier Q001. The confirmed semantic connection E001 is retained in the semantic relationship graph, while the single dangling semantic node H001, the unconfirmed semantic connection E002, and the unconfirmed semantic connection E003 are left to be processed in the subsequent attribution mask generation process.
[0030] The present invention is further configured such that generating the attribution mask and forming candidate resource groups includes: For a single dangling semantic node, the semantic attribution inverted index is queried based on each unconfirmed semantic connection corresponding to the single dangling semantic node to obtain the resource identifier corresponding to each unconfirmed semantic connection. Match the resource identifiers corresponding to each semantic connection to be confirmed with the resource identifiers in the candidate resource set. Record the support status of each candidate resource for each semantic connection to be confirmed according to the recording order of each semantic connection to be confirmed in the semantic relationship graph, and generate the ownership mask of each candidate resource. Candidate resources are grouped based on their attribution mask and result category identifier. Candidate resources with different attribution masks but the same result category identifier are grouped as category-independent ambiguity, while candidate resources with different attribution masks and different result category identifiers are grouped to generate category conflict data packets. Specifically, using the candidate resource set, semantic relationship graph, and semantic relationship index generated in the previous steps, each single dangling semantic node is processed sequentially according to its text position. Following the connection order of the semantic connections to be confirmed in the semantic relationship graph, the modified semantic fragments recorded by the single dangling semantic node, the semantic anchors associated with the semantic connections to be confirmed, and the modification relationship types are read and combined to form a semantic attribution index item. Elasticsearch precise term query is then used to retrieve the resource identifiers corresponding to each semantic attribution index item from the semantic attribution inverted index, without re-performing full-text search. A support state sequence is established according to the number of semantic connections to be confirmed, with the first position of the support state sequence corresponding to a connection order of 1. A hash set matching algorithm is used to match the resource identifiers returned by the semantic attribution inverted index with the resource identifiers in the candidate resource set. If a candidate resource appears in the corresponding resource identifier, support state 1 is recorded; otherwise, support state 0 is recorded. The support states are then arranged according to the connection order of the semantic connections to be confirmed to generate an attribution mask for the candidate resources. The number of bits in the attribution mask is the same as the number of semantic connections to be confirmed for the corresponding single dangling semantic node, with each bit corresponding to a semantic connection to be confirmed sequentially. Support state 1 indicates that the candidate resource has explicit support for the corresponding semantic connection to be confirmed. Semantic attribution records support a state of 0, indicating the absence of a corresponding explicit semantic attribution record, but not negating the corresponding semantic relationship. Result category identifiers are read from the semantic relationship index based on resource identifiers. When one resource identifier is associated with multiple result category identifiers, each resource category association record participates in candidate resource grouping. When the target resource set is generated, duplicates are removed based on resource identifiers. Candidate resources with the same attribution mask and the same result category identifier are written into the same candidate group. Non-zero attribution masks corresponding to the same single dangling semantic node are compared. If the attribution masks are different but the result category identifiers are the same, it is determined as a category-independent ambiguity, and the single dangling semantic node is retained. When semantic nodes have different attribution masks and different result category identifiers, a category conflict data packet is generated. This packet records a single dangling semantic node, semantically compatible semantic anchors, semantic connections to be confirmed, connection order, attribution mask, result category identifier, and candidate resource identifier. Candidate resources with all support states of 0 are marked as having insufficient semantic relationship evidence and are retained, not used as a basis for category conflict determination. If a candidate resource with a clear semantic attribution record forms only one non-zero attribution mask, no category conflict data packet is generated, and the current state of the single dangling semantic node and the semantic connection to be confirmed is maintained; these candidate resource groups are directly merged in subsequent steps. This step does not set a new similarity threshold and directly uses the semantically compatible results output from the previous step.Taking the single suspended semantic node H001 in the previous step as an example, the semantic connection to be confirmed E002 is associated with the semantic anchor A001 "stomach - congestion" according to connection order 1, and the semantic connection to be confirmed E003 is associated with the semantic anchor A002 "chest - stuffiness" according to connection order 2. The semantic attribution inverted index records the resource identifier R001 corresponding to "stomach - congestion, night, time attribution" and the resource identifier R002 corresponding to "chest - stuffiness, night, time attribution". The candidate resource set includes resource identifiers R001, R002, and R003. Resource identifier R001 supports the semantic connection to be confirmed E002 and generates an attribution mask 10. Resource identifier R002 supports the semantic connection E003 to be confirmed and generates an attribution mask 01. Resource identifier R003 lacks a corresponding explicit semantic attribution record and generates an attribution mask 00. The semantic relationship index records resource identifier R001 associated with result category identifier C01, resource identifier R002 associated with result category identifier C02, and resource identifier R003 associated with result category identifier C03, thus forming 3 candidate resource groups. Attribution mask 10 and attribution mask 01 are different, and result category identifier C01 and result category identifier C02 are different, generating a category conflict data packet. The candidate resource group corresponding to attribution mask 00 is marked as having insufficient semantic relationship evidence and is retained.
[0031] The present invention is further configured such that, when there are no class conflict data packets, generating the target resource set includes: When there are no conflicting data packets, the candidate resources are grouped and combined to obtain the target resource set; For candidate resource groups identified as category-independent ambiguities, the corresponding single dangling semantic node is retained, and no connection confirmation item is generated. Specifically, the candidate resource groups, category conflict data packets, and semantic relationship graphs output from the preceding steps are received. The candidate resource groups record the attribution mask, result category identifier, resource identifier, and insufficient semantic relationship evidence marker. The absence of category conflict data packets indicates that, for the same single dangling semantic node, there are no two candidate resource groups with both non-zero attribution masks, different attribution masks, and different result category identifiers, including cases where all attribution masks are 0, only one non-zero attribution mask exists, or different non-zero attribution masks correspond to the same result category identifier. When the processing program does not obtain a category conflict data packet, it reads the resource identifiers according to the generation order of the candidate resource groups, merges the resource identifiers in the candidate resource groups using a hash set union algorithm, and deletes duplicate resource identifiers. Candidate resources with an attribution mask of 0 and a semantic relationship insufficient evidence marker are retained. This marker is used to indicate that the corresponding resource lacks a clear semantic attribution record in the final output. The merged result forms the target resource set. At the same time, the association between the resource identifier, candidate resource group, attribution mask, result category identifier, and semantic relationship insufficient evidence marker is retained for subsequent resource retrieval matching result generation process. The target resource set is cached using a Redis set structure. The cache validity period follows the cache validity period determined by the system cache configuration data in the previous step. The cache is deleted after the resource retrieval matching result is generated. For candidate resource groups determined to be category-independent ambiguity, the processing program locates the single dangling semantic node in the semantic relationship graph based on the single dangling semantic node identifier, keeps the single dangling semantic node and the semantic connection to be confirmed unchanged, and writes it to the category-independent ambiguity state. No connection confirmation item is generated, the text to be retrieved is not re-parsed, and the basic search is not re-executed. This step does not set a judgment threshold and directly selects the processing branch based on whether a category conflict data packet exists.As an independent example of conflict-free processing, the preceding steps output a single dangling semantic node H002, a semantic connection to be confirmed E004, a semantic connection to be confirmed E005, and three candidate resource groups in the consultation round Q002. Semantic connection to be confirmed E004 is associated with semantic anchor A001, and semantic connection to be confirmed E005 is associated with semantic anchor A002. The first candidate resource group records the attribution mask 10, the result category identifier C04, and the resource identifier R004; the second candidate resource group records the attribution mask 01, the result category identifier C04, and the resource identifier R005; and the third candidate resource group records the attribution mask 00, the result category identifier C04, the resource identifier R006, and a marker indicating insufficient semantic relationship evidence. Attribution mask 10 and attribution mask 01 are different, but the result category identifier is always C04, therefore, it is determined to be a category-independent discrepancy. The process does not generate category conflict data packets; it merges resource identifiers R004, R005, and R006 into a target resource set, retains the insufficient semantic relationship evidence marker carried by resource identifier R006, and retains a single dangling semantic node H002, unconfirmed semantic connection E004, and unconfirmed semantic connection E005 in the semantic relationship graph. Finally, it outputs the target resource set and the updated semantic relationship graph, and generates resource retrieval matching results based on the target resource set and the semantic relationship graph. The resource retrieval matching results record the resource identifier, result category identifier, semantic anchor coverage relationship, confirmed semantic connection, category-independent ambiguity state, and insufficient semantic relationship evidence marker; when the target resource is associated with a clear semantic attribution record, it reads the corresponding original text fragment and original text evidence position to form matching evidence.
[0032] The present invention is further configured such that, when class conflict data packets exist, generating the target resource set includes: When there are class conflict packets, extract a single dangling semantic node, a semantically compatible semantic anchor, and a semantic connection to be confirmed from the class conflict packets, generate a connection confirmation item, associate each confirmation option in the connection confirmation item with one or more semantic connections to be confirmed, output the connection confirmation item and obtain confirmation information; When the information representation clearly indicates the attribution, determine one or more corresponding target semantic links, filter the cached candidate resource set according to the attribution mask corresponding to the target semantic link, retain the candidate resources that support all target semantic links, and form a target resource set; When the attribution of the confirmed information is uncertain, the candidate resource groups corresponding to the category conflict data packets are retained. The target resource set is formed based on the retained candidate resource groups and marked as semantically unconfirmed. When the filtering result of the candidate resource set is empty, the cached candidate resource set is restored to the target resource set, and the semantic relationship evidence is marked as insufficient; Resource retrieval matching results are generated based on the target resource set and semantic relationship graph. Specifically, the process receives the category conflict data packet, candidate resource group, cached candidate resource set, and semantic relationship graph output from the preceding steps. The category conflict data packet records a single dangling semantic node, semantically compatible semantic anchors, semantic connections to be confirmed, connection order, attribution mask, result category identifier, and candidate resource identifier. Connection confirmation items are generated based on the original expression of the modified semantic fragment recorded by the single dangling semantic node and the original expression of the semantic anchors recorded by the semantic relationship graph. These connection confirmation items include a separate attribution option for each semantic anchor, a common attribution option for all semantic anchors, and an attribution uncertainty option. Each separate attribution option is associated with one semantic connection to be confirmed, and the common attribution option is associated with an uncertain semantic connection. The system associates all pending semantic connections with the option, while options with uncertain attribution are not associated with pending semantic connections. A hash map is used to record the association between the confirmation option identifier and the pending semantic connection. The system outputs connection confirmation items and obtains confirmation information. When the confirmation information corresponds to a single attribution option or a shared attribution option, the pending semantic connection associated with the confirmation option is determined as the target semantic connection, and the semantic attribution confirmation status is set to confirmed. Supporting states in the attribution mask are located according to the connection order of the target semantic connection in the semantic relationship graph. If there is only one target semantic connection, candidate resources with a corresponding support state of 1 are retained; if there are multiple target semantic connections, all corresponding support states are retained. Candidate resources with a value of 1 are used to form a target resource set. When the filtering result is empty, the cached candidate resource set is restored to the target resource set, retaining the confirmed target semantic connections and confirmation information, and a semantic relationship insufficient evidence flag is written, indicating that the target resource set lacks a clear semantic attribution record that simultaneously supports all target semantic connections. When the confirmation information corresponds to an uncertain attribution option, the candidate resource group corresponding to the category conflict data packet is retained, and the resource identifiers in the candidate resource group are merged using a hash set union algorithm, and duplicate resource identifiers are deleted to form the target resource set and write a semantic attribution unconfirmed status. The target resource set follows the previous steps according to the system cache configuration number. Based on the determined cache validity period, the result category identifier and semantic anchor coverage relationship are read according to the resource identifier. Combined with the semantic relationship graph, resource retrieval matching results are generated. These results record the resource identifier, result category identifier, semantic anchor coverage relationship, confirmed semantic connection, target semantic connection, semantic attribution confirmation status, and insufficient semantic relationship evidence. When the target resource is associated with a clearly semantically attributed record, the original text fragment and original text evidence location associated with the clearly semantically attributed record are further read to form matching evidence in the resource retrieval matching results. The entire process does not re-parse the text to be retrieved, nor does it re-query the semantic anchor inverted index or semantic attribution inverted index. No matching threshold is set in this step; the filtering conditions directly use the support status in the target semantic connection and attribution mask associated with the confirmation option.Taking the category conflict data packet generated in the previous steps as an example, the single dangling semantic node H001 corresponds to the original expression "evening", the semantic anchor A001 corresponds to "stomach congestion", the semantic anchor A002 corresponds to "chest tightness", the connection order of the semantic connection to be confirmed E002 is 1, the connection order of the semantic connection to be confirmed E003 is 2, the resource identifier R001 corresponds to the home mask 10 and the result category identifier C01, the resource identifier R002 corresponds to the home mask 01 and the result category identifier C02, and the resource identifier R003 corresponds to the home mask 00 and the result category identifier C03. The processing program generates four confirmation options: one associated with the semantic connection to be confirmed E002, one associated with the semantic connection to be confirmed E003, one associated with the semantic connection to be confirmed E002 and E003, and one not associated with the semantic connection to be confirmed. The confirmation information is "chest tightness". When the "sense of 'both symptoms'" option is selected, the semantic connection to be confirmed, E003, is identified as the target semantic connection, and the semantic attribution confirmation status is set to the confirmed status. Based on the second supporting status of the attribution mask, only resource identifier R002 is retained, forming a target resource set and generating the corresponding resource retrieval matching results. When the confirmation information is "both symptoms are included", the current candidate resource does not have an attribution mask 11. The cached candidate resource set containing resource identifiers R001, R002, and R003 is restored. The semantic connections to be confirmed, E002 and E003, are retained as target semantic connections. The confirmation information and confirmed status corresponding to the common attribution option are retained, and a semantic relationship evidence insufficient marker is written. When the confirmation information is "attribution uncertain", the three candidate resource groups are merged to form a target resource set and the semantic attribution unconfirmed status is written.
[0033] Example 2: Please see Figure 2 This exemplary TCM (Traditional Chinese Medicine) symptom semantic fuzzy triage matching system includes: Semantic index building module: Extracts semantic anchors, modifies semantic fragments, result category identifiers and resource identifiers from text resource data, establishes records with clear semantic attribution, builds inverted indexes with semantic anchors as index items, builds inverted indexes with semantic attribution based on records with clear semantic attribution, and associates result category identifiers with resource identifiers to generate a semantic relationship index; Hanging Node Generation Module: Obtain the text to be retrieved, extract semantic anchors and modifying semantic fragments, establish confirmed semantic connections between clearly attributed modifying semantic fragments and corresponding semantic anchors, retain unattributed modifying semantic fragments as single hanging semantic nodes and establish unconfirmed semantic connections with multiple semantically compatible semantic anchors, and generate a semantic relationship graph and a semantic anchor query set. Attribution determination and grouping module: Based on the semantic anchor query set, a single basic search is performed on the semantic anchor inverted index. The search results are determined as a candidate resource set and written to the cache. Based on the semantic connection to be confirmed, the semantic attribution inverted index is queried to generate the attribution mask of the candidate resources. The candidate resources are grouped according to the attribution mask and the result category identifier. Candidate resource groups with different attribution masks and the same result category identifier are determined as category-independent ambiguity. Candidate resource groups with different attribution masks and different result category identifiers are generated into category conflict data packets. Matching result output module: When there are no category conflict data packets, the candidate resources are grouped and merged to obtain the target resource set; when there are category conflict data packets, a connection confirmation item is generated and confirmation information is obtained. When the confirmation information indicates a clear attribution, the target semantic connection is determined and the cached candidate resource set is filtered using the target semantic connection to obtain the target resource set; when the confirmation information indicates an uncertain attribution, the target resource set is obtained by grouping the retained candidate resources; and resource retrieval matching results are generated based on the target resource set and the semantic relationship graph.
[0034] It should be noted that the semantically ambiguous diagnostic matching system for TCM symptom inquiry provided in the above embodiments and the semantically ambiguous diagnostic matching method for TCM symptom inquiry provided in the above embodiments belong to the same concept. The specific methods of execution of each module and unit have been described in detail in the method embodiments and will not be repeated here. In practical applications, the semantically ambiguous diagnostic matching system for TCM symptom inquiry provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above. This is not a limitation here.
[0035] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A traditional Chinese medical inquiry symptom semantic ambiguity diagnosis matching method, characterized in that, include: S1: Extract semantic anchors, modify semantic fragments, result category identifiers and resource identifiers from text resource data, establish a record with clear semantic attribution, establish a semantic anchor inverted index with semantic anchors as index items, establish a semantic attribution inverted index based on the record with clear semantic attribution, and associate the result category identifier with the resource identifier to generate a semantic relationship index; S2: Obtain the semantic anchors and modifying semantic fragments from the text to be retrieved. Establish confirmed semantic connections between the clearly attributed modifying semantic fragments and their corresponding semantic anchors. Keep the unattributed modifying semantic fragments as single dangling semantic nodes and establish unconfirmed semantic connections with multiple semantically compatible semantic anchors. Generate a semantic relationship graph and a semantic anchor query set. S3: Perform a single basic search on the semantic anchor inverted index based on the semantic anchor query set, determine the search results as a candidate resource set and write them to the cache, query the semantic attribution inverted index based on the semantic join to be confirmed, generate the attribution mask of the candidate resources, form candidate resource groups according to the attribution mask and the result category identifier, determine the candidate resource groups with different attribution masks and the same result category identifier as category-independent ambiguity, and generate category conflict data packets for candidate resource groups with different attribution masks and different result category identifiers; S4: When there are no class conflict packets, the candidate resources are grouped and combined to obtain the target resource set; When there are class conflict packets, a connection confirmation item is generated and confirmation information is obtained. When the confirmation information clearly indicates the attribution, the target semantic connection is determined and the cached candidate resource set is filtered using the target semantic connection to obtain the target resource set. When the attribution of the confirmed information is uncertain, the target resource set is obtained by grouping the retained candidate resources; the resource retrieval matching results are generated based on the target resource set and the semantic relationship graph.
2. The method according to claim 1, wherein, Generating semantic relation indexes includes: Extract resource identifiers, semantic anchors, modified semantic fragments, modified relation types, result category identifiers, original text fragments, and original text evidence locations from text resource data; Determine the attribution relationship between semantic anchors and modifying semantic fragments. For relationships with clear attribution, generate a clear semantic attribution record containing the semantic anchor, modifying semantic fragment, modification relationship type, and resource identifier. For relationships with unclear attribution, do not generate a clear semantic attribution record. A semantic anchor inverted index is built based on semantic anchors, a semantic attribution inverted index is built based on records with explicit semantic attribution, a relationship between result category identifiers and resource identifiers is established, and the original text fragments and original text evidence locations are associated with the corresponding records with explicit semantic attribution, thus generating a semantic relationship index.
3. The method according to claim 1, characterized in that, Establishing a confirmed semantic connection includes: The attribution relationship is determined based on the textual position and pre-defined relational markers between semantic anchors and modifying semantic fragments. When the attribution relationship of a modified semantic fragment is compatible with only one semantic anchor, or when the relation marker explicitly points to a semantic anchor, a confirmed semantic connection is established between the modified semantic fragment and the corresponding semantic anchor.
4. The symptom semantic ambiguity guiding and matching method for traditional Chinese medical diagnosis according to claim 1, characterized in that, Retaining it as a single dangling semantic node and establishing pending semantic connections includes: When there are multiple semantic anchors within the same sentence range of the text to be retrieved, and the modifying semantic fragment lacks a clear attribution, the modifying semantic fragment will be retained as a single dangling semantic node. Each dangling semantic node is connected to a semantically compatible semantic anchor, a connection identifier is assigned to each connection, a semantic connection to be confirmed is generated, and the dangling semantic node is kept from being copied.
5. The symptom semantic ambiguity guiding and matching method for traditional Chinese medical diagnosis according to claim 4, characterized in that, The generation of semantic relationship graphs and semantic anchor query sets includes: Generate a semantic relationship graph by associating semantic anchors, clearly defined semantic fragments, confirmed semantic connections, single dangling semantic nodes, and semantic connections to be confirmed. Extract semantic anchors from the semantic relationship graph and remove duplicates to generate a semantic anchor query set.
6. The symptom semantic ambiguity guiding and matching method for traditional Chinese medical diagnosis according to claim 1, characterized in that, Performing a single basic search and obtaining a set of candidate resources includes: Based on the semantic anchor query set, query the inverted index of semantic anchors, obtain the resource identifiers corresponding to the semantic anchors, and record the semantic anchors covered by each resource identifier; A candidate resource set is generated based on the resource identifier and written to the cache. Basic retrieval does not currently handle the attribution determination of a single dangling semantic node.
7. The symptom semantic ambiguity guiding and matching method for traditional Chinese medical diagnosis according to claim 6, characterized in that, Generating an attribution mask and forming candidate resource groups includes: For a single dangling semantic node, the semantic attribution inverted index is queried based on each unconfirmed semantic connection corresponding to the single dangling semantic node to obtain the resource identifier corresponding to each unconfirmed semantic connection. Match the resource identifiers corresponding to each semantic connection to be confirmed with the resource identifiers in the candidate resource set. Record the support status of each candidate resource for each semantic connection to be confirmed according to the recording order of each semantic connection to be confirmed in the semantic relationship graph, and generate the ownership mask of each candidate resource. Candidate resources are grouped based on their attribution mask and result category identifier. Candidate resources with different attribution masks but the same result category identifier are grouped as category-independent ambiguity, while candidate resources with different attribution masks and different result category identifiers are grouped to generate category conflict data packets.
8. The symptom semantic ambiguity guiding and matching method for traditional Chinese medical diagnosis according to claim 1, characterized in that, When there are no class conflict packets, the target resource set generated includes: When there are no conflicting data packets, the candidate resources are grouped and combined to obtain the target resource set; For candidate resource groups identified as category-independent ambiguity, retain the corresponding single dangling semantic node and do not generate connection confirmation items.
9. The symptom semantic ambiguity guidance matching method for traditional Chinese medical diagnosis according to claim 1, characterized in that, When class conflict packets exist, the target resource set generated includes: When there are class conflict packets, extract a single dangling semantic node, a semantically compatible semantic anchor, and a semantic connection to be confirmed from the class conflict packets, generate a connection confirmation item, associate each confirmation option in the connection confirmation item with one or more semantic connections to be confirmed, output the connection confirmation item and obtain confirmation information; When the information representation clearly indicates the attribution, determine one or more corresponding target semantic links, filter the cached candidate resource set according to the attribution mask corresponding to the target semantic link, retain the candidate resources that support all target semantic links, and form a target resource set; When the attribution of the confirmed information is uncertain, the candidate resource groups corresponding to the category conflict data packets are retained. The target resource set is formed based on the retained candidate resource groups and marked as semantically unconfirmed. When the filtering result of the candidate resource set is empty, the cached candidate resource set is restored to the target resource set, and the semantic relationship evidence is marked as insufficient; Resource retrieval matching results are generated based on the target resource set and semantic relationship graph.
10. A Chinese medical inquiry symptom semantic fuzzy diagnosis matching system for implementing the Chinese medical inquiry symptom semantic fuzzy diagnosis matching method of any one of claims 1-9, characterized in that, include: Semantic index building module: Extracts semantic anchors, modifies semantic fragments, result category identifiers and resource identifiers from text resource data, establishes records with clear semantic attribution, builds inverted indexes with semantic anchors as index items, builds inverted indexes with semantic attribution based on records with clear semantic attribution, and associates result category identifiers with resource identifiers to generate a semantic relationship index; Hanging Node Generation Module: Obtain the text to be retrieved, extract semantic anchors and modifying semantic fragments, establish confirmed semantic connections between clearly attributed modifying semantic fragments and corresponding semantic anchors, retain unattributed modifying semantic fragments as single hanging semantic nodes and establish unconfirmed semantic connections with multiple semantically compatible semantic anchors, and generate a semantic relationship graph and a semantic anchor query set. Attribution determination and grouping module: Based on the semantic anchor query set, a single basic search is performed on the semantic anchor inverted index. The search results are determined as a candidate resource set and written to the cache. Based on the semantic connection to be confirmed, the semantic attribution inverted index is queried to generate the attribution mask of the candidate resources. The candidate resources are grouped according to the attribution mask and the result category identifier. Candidate resource groups with different attribution masks and the same result category identifier are determined as category-independent ambiguity. Candidate resource groups with different attribution masks and different result category identifiers are generated into category conflict data packets. Matching result output module: When there are no class conflict data packets, the candidate resources are grouped and combined to obtain the target resource set; When there are class conflict packets, a connection confirmation item is generated and confirmation information is obtained. When the confirmation information clearly indicates the attribution, the target semantic connection is determined and the cached candidate resource set is filtered using the target semantic connection to obtain the target resource set. When the attribution of the confirmed information is uncertain, the target resource set is obtained by grouping the retained candidate resources; the resource retrieval matching results are generated based on the target resource set and the semantic relationship graph.
