A health consultation method and system

By constructing a health knowledge graph and using BERT and TextCNN models to identify user intent, combined with Neo4j database queries, the problem of inaccurate answers in online health consultations was solved, enabling the generation of accurate information and reducing the pressure on doctors during consultations.

CN122337656APending Publication Date: 2026-07-03QINGDAO TECH MICROVISION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
QINGDAO TECH MICROVISION TECH CO LTD
Filing Date
2026-03-13
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In online health consultations, users often struggle to obtain accurate answers from a vast amount of medical knowledge data, leading to increased workload for doctors.

Method used

A health knowledge graph is constructed, and BERT and TextCNN models are used to identify user intent. Answers are generated by retrieving the knowledge graph using Cypher queries, and the results are stored and retrieved using the Neo4j database.

Benefits of technology

It improved the accuracy of answers, reduced the workload of doctors, and enhanced users' ability to obtain accurate information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122337656A_ABST
    Figure CN122337656A_ABST
Patent Text Reader

Abstract

This invention relates to the field of consultation technology, and in particular to a health consultation method and system. The invention constructs a health knowledge graph; parses user input information to identify user intent; generates Cypher query statements based on the obtained user intent; and retrieves the knowledge graph through the Cypher query statements to generate answers. This not only helps improve the accuracy of question and answer but also helps to alleviate the pressure of consultation to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of consultation technology, and in particular to a health consultation method and system. Background Technology

[0002] With the advancement of information technology, the Internet has become an increasingly important part of social life. More and more patients are choosing to obtain medical information and seek health consultations through the Internet. However, the amount of medical knowledge data obtained through traditional Internet search engine services is vast and scattered, making it difficult for patients to obtain the medical knowledge they need.

[0003] Meanwhile, the rapid development of natural language processing technology has provided a solid foundation for dialogue systems to become a new human-computer interaction method. However, there are a large number of answers to health consultations, and ordinary users need to spend time and energy to search for answers, and generally cannot get accurate answers. Therefore, health data has not been fully utilized. Thus, providing a health consultation system that can provide accurate answers and reduce the pressure on doctors is a work of practical significance. Summary of the Invention

[0004] To address the technical problems mentioned above, this invention provides a health consultation method and system that helps improve the accuracy of answers and alleviates the pressure of consultation to some extent.

[0005] To achieve the above technical solution, in a first aspect, the present invention provides a health consultation method, comprising: Step 1: Construct a health knowledge graph; Step 2: Parse the user input information to identify the user's intent; Step 3: Generate Cypher query statements based on the obtained user intent; Step 4: Retrieve the knowledge graph using Cypher queries to generate the answer.

[0006] Further, step one includes: Collect health knowledge data; Based on the collected health knowledge data, construct health knowledge triples; A knowledge graph is constructed based on the health knowledge triples. The constructed health knowledge graph is stored using a non-relational database.

[0007] Furthermore, step two includes: Construct an intent recognition model based on the BERT and TextCNN models; The constructed intent recognition model is trained; The user's intent is determined by recognizing the user's input information through a trained intent recognition model.

[0008] Furthermore, the collected health knowledge data includes: The Scrapy web scraping framework is used to crawl health knowledge data from the Internet to obtain health-related data. The obtained health-related data was preprocessed using the XPath scripting language; Regular expressions are used to clean the preprocessed health-related data to remove irrelevant content and obtain health knowledge data. Perform attribute analysis on the cleaned health-related data to unify synonyms and eliminate ambiguity.

[0009] Furthermore, the step of identifying user input information through a trained intent recognition model to determine user intent includes: User input information is entered through the input layer of the BERT model, encoded by the encoding layer of the BERT model, and then output as CLS vectors and word vectors through the output layer. The output character vectors are convolved by the CNN convolutional layer of the TextCNN model to obtain a set of CNN output features; The max pooling layer of the TextCNN model performs max pooling on a set of CNN output features to obtain the pooling result. The concatenation layer of the TextCNN model concatenates the pooling results and the CLS vector, and then outputs the classification result through the fully connected layer and the Softmax classification output layer. The output classification results are parsed to determine user intent.

[0010] Furthermore, the construction of health knowledge triples based on the collected health knowledge data includes: A TF-IDF-based entity extraction method is used to extract entities from collected health knowledge data. Based on the extracted entities, extract the relationships between the entities; Based on the extracted entities and the relationships between them, a health knowledge triple of "entity-relationship-entity" is constructed.

[0011] Secondly, the present invention provides a health consultation system, comprising: The graph construction module is used to build health knowledge graphs; The user intent recognition module is used to parse user input information in order to identify user intent; The query language generation module is used to generate Cypher query statements based on user intent; The answer generation module is used to retrieve the knowledge graph using Cypher queries to generate answers.

[0012] On the other hand, the present invention provides a computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the health consultation method described above.

[0013] The beneficial effects of this invention are as follows: (1) This invention constructs a health knowledge graph and understands the user's intent based on the user's input information. Based on the user's intent, it retrieves and generates answers from the health knowledge graph, which not only helps to improve the accuracy of question and answer, but also helps to reduce the pressure of consultation to a certain extent.

[0014] (2) This invention uses a non-relational database, such as Neo4j graph database, to store the health knowledge graph for easy querying.

[0015] (3) This embodiment is based on the BERT model and the TextCNN model. The combination of the two helps to distinguish relatively ambiguous intentions and can capture the subtle semantic features of the question, thereby improving the accuracy of answer generation. Attached Figure Description

[0016] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0017] Figure 1 This is a flowchart of a health consultation method according to the present invention.

[0018] Figure 2 This is a flowchart illustrating the process of recognizing user input information according to the present invention. Detailed Implementation

[0019] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0020] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, each technical and scientific term used in these embodiments has the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0021] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0022] In this invention, terms such as "upper," "lower," "left," "right," "front," "back," "vertical," "horizontal," "side," and "bottom" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are used only to facilitate the description of the structural relationships of the various components or elements of this invention and do not specifically refer to any component or element in this invention. They should not be construed as limiting the invention.

[0023] In this invention, terms such as "fixed connection," "connected," and "linked" should be interpreted broadly, indicating a fixed connection, an integral connection, or a detachable connection; a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can determine the specific meaning of these terms in this invention based on the specific circumstances, and they should not be construed as limitations on the invention.

[0024] Multimodal data refers to data composed of two or more modalities, which can be information sources of different forms or different formats of the same form.

[0025] Example 1: like Figure 1 As shown, this embodiment provides a health consultation method, including the following steps: S1: Construct a health knowledge graph.

[0026] Specifically, the following steps are included: S11: Collect health knowledge data.

[0027] S11-1 uses the Scrapy web scraping framework to crawl health knowledge data from the Internet to obtain health-related data.

[0028] Scrapy, a web scraping framework, is a network packet processing tool whose main functions include sending messages and receiving responses. This article simulates messages, uses Scrapy to send these messages, and captures the corresponding responses. By matching requests and responses, a list of (request, response) message pairs is obtained. Processing the returned list of message pairs yields relevant health-related data.

[0029] S11-2: Preprocess the obtained health-related data using the XPath scripting language.

[0030] Because the XPath scripting language can extract content from HTML data by tags, it greatly improves the efficiency of data preprocessing.

[0031] S11-3: Use regular expressions to clean the preprocessed health-related data to remove irrelevant content and obtain health knowledge data.

[0032] S11-4: Perform attribute analysis on the cleaned health-related data to unify synonyms and eliminate ambiguity.

[0033] S12: Construct health knowledge triples based on the collected health knowledge data.

[0034] Specifically, the following steps are included: S12-1: A TFIDF-based entity extraction method for extracting entities from collected health knowledge data.

[0035] Specifically, the entity extraction method based on TFIDF consists of two computational parts: one part is to calculate the TF term frequency, which is to calculate the frequency of a certain word in a document; the other part is the IDF (inverse document frequency), which is the frequency of documents containing a certain word in a document set.

[0036] The product of TF and IDF is calculated using the following formula:

[0037] in, For words The frequency of words in text d, where T is the total number of words in text d after processing. For text collections containing words The number of documents.

[0038] S12-2: Based on the extracted entities, extract the relationships between the entities.

[0039] The relationships between entities include inclusion relationships (general-specific, whole-part), sequential relationships (order, parallel, progressive), and correlation relationships (support).

[0040] For ease of understanding and explanation, this embodiment uses two entities, Ax and Ay, as examples.

[0041] First, define the relative co-occurrence of entity Ax with respect to entity Ay, using the following formula:

[0042] in, The frequency of occurrence of entities Ax and Ay in the specified document; It represents the frequency of entity Ay in the specified document.

[0043] Secondly, the co-occurrence degree of entities Ax and Ay is defined, and the specific formula is as follows:

[0044] Finally, relationships between entities are extracted based on the defined co-occurrence.

[0045] This embodiment improves extraction efficiency by standardizing the number of documents and entities under subject categories with large differences in quantity by statistically analyzing the frequency of co-occurrence between entities.

[0046] S12-3, Based on the extracted entities and the relationships between entities, construct a health knowledge triple of "entity-relationship-entity".

[0047] By constructing health knowledge triples, it is possible to reduce storage space usage and improve performance with the same amount of data.

[0048] S13: Construct a knowledge graph based on the constructed health knowledge triples.

[0049] Specifically, in the process of constructing a knowledge graph, knowledge fusion is carried out by entity alignment and repetition merging in the health knowledge triples to simplify the internal entities of the graph and improve the graph's operating efficiency.

[0050] For example, entity alignment is performed for "chills" and "shivering," merging "McBurney's point" and "McBurney's point" into a single entity. After extracting entities and relationships at the data layer and obtaining the basic data source for the constructed knowledge graph, knowledge is integrated using third-party knowledge bases (other courses on the same platform, Baidu Encyclopedia, Sogou Encyclopedia, CNKI, PubMed, etc.) to improve and expand the existing knowledge graph, thereby achieving open knowledge sharing. For instance, using the "acute appendicitis" knowledge unit and attributes such as "nursing measures" from the surgical nursing course, knowledge such as nursing measures for acute appendicitis is extracted and incorporated into the health knowledge graph.

[0051] S14: Use a non-relational database to store the constructed health knowledge graph.

[0052] Specifically, a non-relational database, such as Neo4j graph database, is selected to store the health knowledge graph for easy querying.

[0053] S2: Parse the user input information to identify the user's intent.

[0054] Specifically, it includes the following steps: S21: Construct an intent recognition model based on the BERT and TextCNN models.

[0055] The BERT model consists of an input layer, an encoding layer, and an output layer. The TextCNN model consists of a CNN layer, a max pooling layer, a concatenation layer, a fully connected layer, and a Softmax classification output layer.

[0056] S22: Train the constructed intent recognition model.

[0057] Specifically, the BERT model includes an Embedding module, a Transformer module, and an output fine-tuning module; the Embedding module mainly consists of a Token Embeddings tensor, a Segment Embeddings tensor, and a Position Embeddings tensor.

[0058] Token Embeddings is a word embedding tensor used to vectorize words and input a CLS flag at the beginning for classification tasks.

[0059] Segment Embeddings are tensors used to understand sentences from the input NSP (Next Sentence Prediction) pre-training task.

[0060] Position Embeddings are position-encoded tensors used to learn vectors describing the sequence order information at each position.

[0061] It should be noted that the input to the entire Embedding module is simply the sum of all the elements to obtain the input to the encoding layer.

[0062] The Transformer module contains only the Encoder, which consists of multiple stacked encoders to encode the input.

[0063] The output fine-tuning module is used to adjust the input information after it has been encoded by the Encoder in the Transformer module according to the task requirements, so that the model output meets the task requirements.

[0064] S23: Use a trained intent recognition model to identify user input information in order to determine the user's intent.

[0065] like Figure 2 As shown, the specific steps include: S23-1: User input information is input through the input layer of the BERT model. After the encoding layer of the BERT model encodes the input information, the output layer outputs CLS vectors and word vectors.

[0066] S23-2: The output word vectors are convolved by the CNN convolutional layer of the TextCNN model to obtain a set of CNN output features.

[0067] S23-3: The max pooling layer of the TextCNN model performs max pooling on a set of CNN output features to obtain the pooling result.

[0068] S23-4: The concatenation layer of the TextCNN model concatenates the pooling results and the CLS vector, and then outputs the classification result through the fully connected layer and the Softmax classification output layer.

[0069] S23-5: Analyze the output classification results to determine user intent.

[0070] This embodiment is based on the BERT model and the TextCNN model. Combining the two helps to distinguish ambiguous intentions and can capture subtle semantic features of questions, thereby improving the accuracy of answer generation.

[0071] S3: Generate Cypher query statements based on user intent.

[0072] In this embodiment, Cypher query statements are generated, and Cypher language is used as a query tool to query the knowledge graph. This helps to provide users with a powerful and flexible query experience, making in-depth exploration of the knowledge graph easier.

[0073] S4: Access the stored knowledge graph using Cypher queries to generate answers.

[0074] Specifically, the stored knowledge graph is accessed using Cypher queries, and the query results are converted into natural language format to generate answers that are then presented to the user.

[0075] The generated answer includes the entities obtained from the query and the information about the relationships between them.

[0076] Example 2: This embodiment provides a health consultation system, including: The graph construction module is used to build health knowledge graphs; The user intent recognition module is used to parse user input information in order to identify user intent; The query language generation module is used to generate Cypher query statements based on user intent; The answer generation module is used to retrieve the knowledge graph using Cypher queries to generate answers.

[0077] Example 3: This embodiment provides a computer-readable storage medium including a stored program, wherein, when the program is running, it controls the device where the computer-readable storage medium is located to execute a health consultation method as described in Embodiment 1.

[0078] The same or similar parts between the various embodiments in this specification can be referred to mutually. In particular, the terminal embodiments are basically similar to the method embodiments, so the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.

[0079] In the embodiments provided by this invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.

[0080] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0081] Additionally, it should be noted that the flowcharts in the accompanying drawings illustrate methods according to embodiments of this disclosure. In the descriptions corresponding to the flowcharts or block diagrams in the drawings, the operations or steps corresponding to different blocks may occur in a different order than disclosed in the description; sometimes, there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the function involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.

[0082] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A health consultation method, characterized in that, include: Step 1: Construct a health knowledge graph; Step 2: Parse the user input information to identify the user's intent; Step 3: Generate Cypher query statements based on the obtained user intent; Step 4: Retrieve the knowledge graph using Cypher queries to generate the answer.

2. The health consultation method according to claim 1, characterized in that, Step one includes: Collect health knowledge data; Based on the collected health knowledge data, construct health knowledge triples; A knowledge graph is constructed based on the health knowledge triples. The constructed health knowledge graph is stored using a non-relational database.

3. The health consultation method according to claim 1, characterized in that, Step two includes: Construct an intent recognition model based on the BERT and TextCNN models; The constructed intent recognition model is trained; The user's intent is determined by recognizing the user's input information through a trained intent recognition model.

4. The health consultation method according to claim 2, characterized in that, The collected health knowledge data includes: The Scrapy web scraping framework is used to crawl health knowledge data from the Internet to obtain health-related data. The obtained health-related data was preprocessed using the XPath scripting language; Regular expressions are used to clean the preprocessed health-related data to remove irrelevant content and obtain health knowledge data. Perform attribute analysis on the cleaned health-related data to unify synonyms and eliminate ambiguity.

5. The health consultation method according to claim 3, characterized in that, The process of identifying user input information using a trained intent recognition model to determine user intent includes: User input information is entered through the input layer of the BERT model, encoded by the encoding layer of the BERT model, and then output as CLS vectors and word vectors through the output layer. The output character vectors are convolved by the CNN convolutional layer of the TextCNN model to obtain a set of CNN output features; The max pooling layer of the TextCNN model performs max pooling on a set of CNN output features to obtain the pooling result. The concatenation layer of the TextCNN model concatenates the pooling results and the CLS vector, and then outputs the classification result through the fully connected layer and the Softmax classification output layer. The output classification results are parsed to determine user intent.

6. The health consultation method according to claim 2, characterized in that, The construction of health knowledge triples based on the collected health knowledge data includes: A TF-IDF-based entity extraction method is used to extract entities from collected health knowledge data. Based on the extracted entities, extract the relationships between the entities. Based on the extracted entities and the relationships between them, a health knowledge triple of "entity-relationship-entity" is constructed.

7. A health consultation system, characterized in that, include: The graph construction module is used to build health knowledge graphs; The user intent recognition module is used to parse user input information in order to identify user intent; The query language generation module is used to generate Cypher query statements based on user intent; The answer generation module is used to retrieve the knowledge graph using Cypher queries to generate answers.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the health consultation method according to any one of claims 1 to 6.