Mental health question-answering system and method based on knowledge graph
Through a mental health question-and-answer system based on knowledge graphs, using Aho-Corasick algorithm and deep learning model to quickly identify intentions and entities, build a mental health knowledge graph, solve the high cost and inefficiency problems of psychological diseases prevention and diagnosis of college students, and realize the psychology Efficient search and accurate prediction of health knowledge.
Patent Information
- Application Number
- CN202411342463.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-14
AI Technical Summary
The existing technology cannot effectively prevent and diagnose psychological diseases in college students. The traditional psychological problem prediction methods have problems of high cost, low efficiency and low accuracy, and the psychological knowledge is complex and difficult to sort out, resulting in low efficiency in predicting psychological problems.
Adopt a mental health question-and-answer system based on knowledge graphs, and build a mental health knowledge graph, combine Aho-Corasick algorithm and deep learning model for intention and entity recognition, quickly retrieve mental health knowledge, and reduce the time, manpower and economic costs of self-examination and self-examination. .
It realizes efficient retrieval and accurate prediction of mental health knowledge, simplifies the self-examination and diagnosis process of psychological problems, reduces the cost of mental health diagnosis and treatment, and improves the efficiency of information dissemination.
Smart Images

Figure CN119311800A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge graphs and their application technologies, and more specifically to a mental health question-answering system and method based on a knowledge graph. Background Art
[0002] In recent years, anxiety has been spreading in society. Academics, job hunting, socializing, marriage and love have all become the objects of anxiety for modern young people. Studies have found that young people aged 18 to 24 are a group with frequent mental illnesses such as depression and anxiety. At present, my country does not have a standardized system for the prevention, diagnosis and treatment of mental illnesses for college students. Traditional psychological problem prediction methods usually rely on questionnaires, which are easily disturbed by individual subjective consciousness, have relatively low recovery rates and accuracy, and have a certain lag, making it impossible to effectively carry out prevention work. At the same time, the field of psychology has a lot of knowledge and a complex organizational structure, which is not easy to sort out and extract, so it is impossible to achieve efficient and accurate prediction of psychological problems.
[0003] Traditional psychological counseling methods face problems such as high labor costs, expensive counseling fees, cumbersome procedures, and low efficiency, making these services difficult to popularize among the general public.
[0004] Therefore, improving the efficiency of psychological problem prediction and reducing the manpower, time and economic costs of conventional psychological queries are issues that technical personnel in this field urgently need to solve. Summary of the invention
[0005] In view of this, the present invention provides a mental health question-and-answer system and method based on a knowledge graph, which helps to reduce the difficulty of retrieving mental health knowledge and reduce the time, manpower and economic costs of self-examination of early psychological problems.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] A mental health question-answering system based on knowledge graph, comprising: a knowledge graph construction module, a text input module, an intention recognition module, an entity recognition module, an answer query module and a result display module;
[0008] The knowledge graph construction module collects mental health text data to construct a mental health knowledge graph;
[0009] The text input module receives the query text and sends it to the intention recognition module and the entity recognition module;
[0010] The intention recognition module uses the Aho-Corasick algorithm to perform rule matching based on the query text and predefined question types to obtain the intention recognition result and send it to the answer query module; the Aho-Corasick algorithm can quickly extract the core intention in the user query by performing multi-mode matching on predefined mental health problem categories, and enhance the recognition ability of fuzzy questions in combination with a semantic parsing model based on deep learning, thereby improving the accuracy of intention recognition;
[0011] The entity recognition module performs named entity recognition based on the query text by combining the combined model BERT+BiLSTM+CRF constructed by using the pre-trained model, the bidirectional long short-term memory network and the conditional random field model, obtains the entity recognition result and sends it to the answer query module; the BERT model generates context-related word vectors, the BiLSTM model further captures the context dependency, and the conditional random field model (CRF model) optimizes the label sequence by calculating the emission score and the transfer score;
[0012] The answer query module combines the intention recognition result and the entity recognition result, associates them with the mental health knowledge graph, obtains the query result and sends it to the result display module;
[0013] The result display module displays the query results and presents the complex related information in the knowledge graph through a concise interface and statements to facilitate user understanding.
[0014] Preferably, the knowledge graph construction module includes a mental health ontology library, a mental health text data crawling unit, a mental health text data fusion unit and a mental health text data storage unit;
[0015] The mental health ontology library is used to construct a graph framework, in which the categories, attributes and relationships of entities are set; the entity is the mental health ontology, and its attributes and relationships refer to the characteristics of the entity and the connection between them respectively;
[0016] The mental health text data crawling unit is used to crawl the mental health text data on the web page, use natural language processing technology (such as word segmentation, part-of-speech tagging, named entity recognition) to perform preliminary processing on the crawled mental health text data, convert the data into a structured or semi-structured format to facilitate subsequent processing and storage, and pass it to the mental health text data fusion unit;
[0017] The mental health text data fusion unit is used to select one from the crawling websites of mental health text data as an alignment standard, perform entity alignment and ontology fusion on the mental health text data obtained from other websites and the mental health text data corresponding to the alignment standard, complete data fusion, and obtain fused data; entity alignment is mainly the alignment of entities and the disambiguation of repeated and fuzzy entities to ensure the unity and consistency of data, while ontology fusion is to eliminate synonymous and near-synonymous entities through semantic similarity calculation, realize ontology fusion from different sources, and can effectively process heterogeneous data from different sources to generate a standardized knowledge base;
[0018] The mental health text data storage unit is used to import the fused data into the mental health ontology library according to the graph framework for storage, and generate the mental health knowledge graph.
[0019] Preferably, the knowledge graph construction module also includes a mental health text data preprocessing unit, which preprocesses the mental health text data crawled by the mental health text data crawling unit, and transmits the preprocessed data to the mental health text data fusion unit; the preprocessing includes word segmentation, part-of-speech tagging, entity disambiguation and data fusion.
[0020] Preferably, the combined model BERT+BiLSTM+CRF includes an input layer, a pre-training layer, a feature extraction layer, a decoding layer and an output layer;
[0021] The input layer is used to perform preliminary preprocessing on the query text, mainly including Chinese word segmentation and data cleaning, and then use the output result obtained from the preliminary preprocessing as the input of the pretraining layer;
[0022] The pre-training layer uses the trained BERT model to map the sentences of the output results into word vectors as inputs of the neural network in the feature extraction layer;
[0023] The feature extraction layer uses a trained BiLSTM model to extract features from the word vectors, and passes the extracted sequence features to the decoding layer;
[0024] The decoding layer uses the trained CRF model to decode the sequence features output by the feature extraction layer and screen out the label prediction results; these label prediction results represent entity, category and location information; this layer calculates the scores of all possible label sequences by learning the dependencies and transition probabilities between label sequences, and uses the Viterbi algorithm to screen out the label sequence with the highest score, and combines the emission score and the transition score to ensure that the generated label sequence is globally optimal, and generate the final label prediction result;
[0025] The output layer presents the label prediction results in the form of a dictionary for each entity and its corresponding category and location information as the entity recognition result.
[0026] Preferably, the entity recognition module also uses entity disambiguation technology to process repeated or synonymous entity expressions, and performs entity alignment in combination with known entities in the knowledge graph to ensure the consistency and accuracy of the recognition results.
[0027] Preferably, the answer query module generates Cypher query statements to perform associated queries in the neo4j graph database, providing multi-level query results. In addition, the module introduces dynamic query optimization technology to adjust query strategies according to different query intentions to improve query efficiency.
[0028] A mental health question-answering method based on knowledge graph, comprising the following steps:
[0029] S1. Get the query text entered by the user;
[0030] S2. Perform intent recognition based on rule matching and entity recognition based on the combined model BERT+BiLSTM+CRF on the query text to obtain parsing results;
[0031] S3. Performing an associated query based on the analysis result and the pre-built mental health knowledge graph to obtain a query result or a preset default result;
[0032] S4. Display the query result or the default result.
[0033] Preferably, in S2, intent is extracted from the query text by intent recognition to obtain an intent recognition result; and entities are extracted from the query text by entity recognition to obtain an entity recognition result.
[0034] Preferably, the specific content of S3 includes:
[0035] S31. Storing entities, attributes and relationships set in the mental health ontology library in the neo4j graph database;
[0036] S32. Match the intent recognition results and entity recognition results identified from the query text with the entities in the neo4j graph database to obtain the query target entities and relationships; obtain the entity and relationship information related to the query through the matching process, including the target entity in the user query and its corresponding contextual relationship;
[0037] S33. Generate a corresponding Cypher query statement based on the query target entities and relationships obtained in S32, perform a query in the neo4j graph database, and return the query result. The Cypher query statement converts the intent recognition results and entity recognition results into graph query conditions, and combines the entity and relationship information stored in the graph database to query and return the matching data.
[0038] Preferably, the specific implementation steps of using dynamic query optimization technology to perform query in S33 include:
[0039] S331. Query intent analysis and optimized path selection: Based on the intent recognition results, the complexity of the user query is preliminarily evaluated; for simple queries (such as single-entity queries), basic Cypher query statements are directly generated; for complex queries (such as multi-entity and multi-relationship queries), entity nodes with higher matching degrees are preferentially selected as entry points to narrow the query scope and avoid full-graph traversal;
[0040] S332.Introduction of indexing and caching mechanism: Indexes are created for common high-frequency query paths and core entities in the neo4j graph database to reduce the node search time during the query process. At the same time, for highly repetitive queries, the system will cache previous query results to further reduce query time, especially for multiple consecutive queries by the same user;
[0041] S333. Real-time resource management: When executing a query, the system dynamically allocates resources according to the server load, giving priority to important or complex query tasks to prevent query delays caused by resource competition, and ensuring the concurrent execution efficiency of query tasks by adjusting query threads and memory usage;
[0042] S334. Query execution path optimization: For complex queries, dynamically adjust the query order, give priority to sub-queries with clearer filtering conditions, limit the query results to a smaller range, and then perform more in-depth relationship matching.
[0043] Preferably, the specific steps of pre-constructing the mental health knowledge graph are:
[0044] S51. Construct a mental health ontology library as a graph framework and set the categories, attributes and relationships of the mental health ontology;
[0045] S52. Crawl mental health text data on web pages;
[0046] S53. Select one of the websites from which the mental health text data is obtained as an alignment standard, perform entity alignment and ontology fusion on the mental health text data obtained from other websites and the mental health text data corresponding to the alignment standard, complete data fusion, and obtain fused data;
[0047] S54. Import the fused data into the mental health ontology library for storage and generate a mental health knowledge graph.
[0048] Preferably, S52 also includes preprocessing the crawled mental health text data, wherein the semi-structured data and unstructured data in the mental health text data are segmented and tagged with parts of speech, so that entity disambiguation and data fusion are performed on duplicate data in S53 to achieve preprocessing of the mental health text data. The quality and consistency of the data are improved through preprocessing, making the original semi-structured and unstructured mental health text data more standardized and understandable, thereby improving the answer quality and accuracy of the mental health question-answering system.
[0049] It can be seen from the above technical solution that compared with the prior art, the present invention discloses a mental health question-and-answer system and method based on a knowledge graph, constructs a knowledge graph related to mental health, and structurally represents a large amount of psychological knowledge, disease classification, treatment plans and other information, thereby simplifying information retrieval and search; on this basis, an intention recognition module and an entity recognition module are designed to parse the query text, and the intent and entity are matched in the constructed knowledge graph according to the parsed intent, so as to quickly retrieve the corresponding query results, and provide accurate and comprehensive information support for mental health self-examination and diagnosis. The present invention simplifies the retrieval and search process of information such as psychology-related knowledge, disease classification and treatment plans, provides accurate and comprehensive information support for mental health self-examination and diagnosis, assists in the early self-examination of mental health problems, and reduces the cost of mental health diagnosis and treatment and the threshold for the dissemination of professional psychological knowledge. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0051] Figure 1 A schematic diagram of a process flow of a mental health question-answering method based on a knowledge graph provided by the present invention;
[0052] Figure 2 A schematic diagram of the overall process of constructing a psychology knowledge graph provided by the present invention. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] The embodiment of the present invention discloses a mental health question-and-answer system based on a knowledge graph, comprising: a knowledge graph construction module, a text input module, an intention recognition module, an entity recognition module, an answer query module and a result display module; the knowledge graph construction module is used to construct a corresponding mental health knowledge graph according to text data from an authoritative psychology website and a WeChat public account; the text input module is used to realize the input of a query text, and send the acquired query text to the intention recognition module and the entity recognition module; the intention recognition module is used to receive the query text, and perform rule matching on the user input question by pre-defining the question type and using the Aho-Corasick algorithm to obtain the intention recognition result; the entity recognition module is used to receive the query text, and perform a named entity recognition task by combining a pre-trained model, a bidirectional long short-term memory network and a conditional random field model. The combined model BERT+BiLSTM+CRF, which is a combination of a pre-trained model, a bidirectional long short-term memory network and a conditional random field model, obtains the entity recognition result; the answer query module is used to associate with the mental health knowledge graph according to the combination of the intention recognition result and the entity recognition result, obtain the query result of the query text and send it to the result display module; the result display module is used to display the query result.
[0055] In order to further realize the above technical scheme, the knowledge graph construction module includes a mental health ontology library, a mental health text data crawling unit, a mental health text data fusion unit and a mental health text data storage unit; the mental health ontology library is used to construct a graph framework and clarify the categories, attributes and relationships of the mental health ontology; the mental health text data crawling unit is used to crawl the mental health text data on the web page and pass it to the mental health text data fusion unit; the mental health text data fusion unit is used to select one from the website sources of the mental health text data obtained by the mental health text data crawling unit as an alignment standard, and perform entity alignment and ontology fusion on the mental health text data obtained from other websites with the mental health text data corresponding to the alignment standard to complete data fusion; the mental health text data storage unit is used to import the fused data into the mental health ontology library for storage to generate a mental health knowledge graph.
[0056] In order to further realize the above technical scheme, the graph framework constructed by the mental health ontology library includes the categories, attributes and relationships of entities. The entities are also mental health ontology, and their attributes and relationships refer to the characteristics of entities and the connections between them respectively. In this embodiment, according to the information contained in the mental health ontology library, Wenyi.com and Xunyiwenyao.com are used as the main data sources, and the mental health data is acquired through Python web crawlers to realize the jump between web pages and page parsing, and complete the automatic extraction of mental health text data. According to the amount of data information crawled from different websites and its fragmentation, the mental health text data of Wenyi.com is used as the alignment standard, and the mental health text data acquired from other websites is matched with it to realize the integration and standardization of data, complete entity alignment, and complete data fusion. The files after the mental health text data is fused are summarized and sorted, corresponding to the mental health knowledge ontology library, and multiple csv files of entities, relationships and attributes are generated. The data are imported into the neo4j graph database for storage using the import method to complete the construction of the mental health knowledge graph.
[0057] In order to further implement the above technical solution, the knowledge graph construction module also includes a mental health text data preprocessing unit, which preprocesses the mental health text data crawled by the mental health text data crawling unit. In this embodiment, the semi-structured data and unstructured data in the mental health text data are segmented and tagged, and the duplicate data are entity disambiguated and data fused to achieve the preprocessing of the mental health text data.
[0058] In order to further implement the above technical solution, the system in this embodiment is developed based on the python lightweight streamlit framework, and the question and answer query method adopts the form of a question input box, an answer display box and a historical question and answer record table; the text input module is the question input box, and the query sentence is input as the query text; the result display module is the answer display box, which is used to display the query results; by also displaying the historical question and answer record table, historical question and answer information can be queried.
[0059] In order to further realize the above technical solution, the entity recognition module includes an input layer, a pre-training layer, a feature extraction layer, a decoding layer and an output layer; the input layer is used to perform preliminary pre-processing on the query text, mainly including Chinese word segmentation and data cleaning, and then the output result is used as the input of the pre-training layer; the pre-training layer uses the trained BERT model to map the sentences of the output results into word vectors as the input of the neural network in the feature extraction layer; the feature extraction layer uses the trained BiLSTM model to extract features from the word vectors, and the extracted sequence features are passed to the decoding layer; the decoding layer uses the trained CRF model to screen and score the label sequence, and uses the Viterbi algorithm to screen the label sequence with the highest score and pass it to the output layer; the output layer uses the label sequence with the highest score as the entity recognition result, and the final result is output in the form of a dictionary, presenting each entity and its corresponding category and location information.
[0060] On the other hand, in a specific embodiment, a mental health question-answering method based on a knowledge graph is disclosed, such as Figure 1 The following steps are shown:
[0061] S1. Get the query text entered by the user;
[0062] S2. The query text is respectively subjected to intention recognition based on rule matching and entity recognition based on the combined model BERT+Bi-LSTM+CRF to parse the query text and obtain parsing results; the parsing results include intention recognition results and entity recognition results;
[0063] S3. Perform relevant mental health queries based on the parsing results and the pre-built mental health knowledge graph, and obtain query results or default results;
[0064] S4. Display the query results or preset default results.
[0065] In order to further implement the above technical solution, the specific contents of S3 include:
[0066] S31. Store the entities, attributes and collected mental health professional terms in the mental health knowledge graph in the neo4j graph database;
[0067] S32. Match the intent recognition results and entity recognition results with the entities in the neo4j graph database to obtain the query target entity and relationship; obtain the entity and relationship information related to the query through the matching process, including the target entity in the user query and its corresponding contextual relationship;
[0068] S33. Based on the query target entities and relationships matched in S32, a corresponding Cypher query statement is formed and queried in the neo4j graph database, and the query result is returned; if no entity is matched, a default result is returned, and the default result is displayed as "No corresponding result was retrieved, please try to ask again".
[0069] In order to further implement the above technical solution, we generate Cypher query statements to perform related queries in the neo4j graph database and provide multi-level query results. In addition, we introduce dynamic query optimization technology to adjust query strategies according to different query intentions and improve query efficiency. The specific implementation steps of dynamic query optimization technology include:
[0070] S331. Query intent analysis and optimized path selection: Based on the intent recognition results, the complexity of the user query is preliminarily evaluated; for simple queries (such as single-entity queries), basic Cypher query statements are directly generated; for complex queries (such as multi-entity and multi-relationship queries), entity nodes with higher matching degrees are preferentially selected as entry points to narrow the query scope and avoid full-graph traversal;
[0071] S332.Introduction of indexing and caching mechanism: Indexes are created for common high-frequency query paths and core entities in the neo4j graph database to reduce the node search time during the query process. At the same time, for highly repetitive queries, the system will cache previous query results to further reduce query time, especially for multiple consecutive queries by the same user;
[0072] S333. Real-time resource management: When executing a query, the system dynamically allocates resources according to the server load, giving priority to important or complex query tasks to prevent query delays caused by resource competition, and ensuring the concurrent execution efficiency of query tasks by adjusting query threads and memory usage;
[0073] S334. Query execution path optimization: For complex queries, dynamically adjust the query order, give priority to sub-queries with clearer filtering conditions, limit the query results to a smaller range, and then perform more in-depth relationship matching.
[0074] In order to further implement the above technical solution, the process of constructing the mental health knowledge graph is as follows: Figure 2 As shown, the specific steps are:
[0075] S51. Use web crawler technology to crawl relevant text data from multiple authoritative mental health websites (such as mental health consultation platforms, medical institutions, etc.), covering psychological theories, disease classifications, treatment plans, psychological consultation questions and answers, etc.;
[0076] S52. Perform basic preprocessing on the text data during the crawling process, including removing redundant data, extracting key information, and performing structured storage according to a predetermined format;
[0077] S53. Construct a mental health ontology library as a graph framework, establish an ontology model in the field of mental health through knowledge extraction, and determine the entities, attributes and relationships related to mental health;
[0078] S54. Combine the collected mental health ontologies from different sources with existing domain knowledge to perform ontology fusion. Use ontology alignment technology to identify synonymous or near-synonymous entities in ontologies from different sources, and perform unified and standardized processing on them to eliminate redundant definitions. In the ontology fusion process, use semantic similarity calculation and hyponym relationship analysis to ensure that the merged ontology has consistency and integrity, and generate a standardized mental health ontology framework.
[0079] S55. Select one of the websites that obtain mental health text data as the alignment standard, and perform entity alignment on the mental health text data obtained from other websites with the mental health text data corresponding to the alignment standard, complete data fusion, and obtain fused data; entity alignment means determining the data of a website as a reference standard, and aligning the data from other sources with the standard through methods such as semantic similarity calculation, entity name normalization, and context analysis. For example, if different websites use different descriptions of the same mental illness, they are classified as the same entity through entity alignment; attribute alignment means aligning the same or similar attributes in text data from different sources, such as "symptom description" and "disease manifestation", and unifying the standard naming through attribute similarity calculation;
[0080] S56. The fused data is mapped according to the structure in the ontology library and imported into the neo4j graph database; the stored knowledge graph contains entities, attributes and their relationships for subsequent query and display;
[0081] S57. After the knowledge graph is constructed, the latest mental health text data is regularly crawled and compared with the existing knowledge graph. Through entity alignment and attribute matching, the newly added entities and attributes are integrated into the existing graph to maintain the real-time and accuracy of the graph. In addition, by analyzing the user's query behavior, the query algorithm and path are continuously optimized to improve the query speed and relevance of the results.
[0082] In order to further implement the above technical solution, the crawled mental health text data is preprocessed in S52, wherein the semi-structured data and unstructured data in the mental health text data are segmented and tagged with parts of speech, so that entity disambiguation and data fusion can be performed on duplicate data, thereby realizing the preprocessing of the mental health text data.
[0083] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0084] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A mental health question-answering system based on knowledge graph, characterized in that: include: Knowledge graph construction module, text input module, intent recognition module, entity recognition module, answer query module and result display module; The knowledge graph construction module collects mental health text data to construct a mental health knowledge graph; The text input module receives the query text and sends it to the intention recognition module and the entity recognition module; The intention recognition module performs intention recognition on the query text, obtains the intention recognition result and sends it to the answer query module; The entity recognition module performs entity recognition on the query text, obtains entity recognition results and sends them to the answer query module; The answer query module combines the intention recognition result and the entity recognition result, associates them with the mental health knowledge graph, obtains the query result and sends it to the result display module; The result display module is used to display the query result.
2. According to claim 1, a mental health question-answering system based on knowledge graph is characterized in that: The knowledge graph construction module includes a mental health ontology library, a mental health text data crawling unit, a mental health text data fusion unit and a mental health text data storage unit; The mental health ontology library is used to construct a graph framework, in which the categories, attributes and relationships of entities are set; The mental health text data crawling unit is used to crawl the mental health text data on the web page and transfer it to the mental health text data fusion unit; The mental health text data fusion unit is used to select one of the crawling websites for mental health text data as an alignment standard, perform entity alignment and ontology fusion on the mental health text data obtained from other websites and the mental health text data corresponding to the alignment standard, complete data fusion, and obtain fused data; The mental health text data storage unit is used to store the fused data according to the graph framework to generate the mental health knowledge graph.
3. A mental health question-answering system based on knowledge graph according to claim 2, characterized in that: The knowledge graph construction module also includes a mental health text data preprocessing unit, which preprocesses the crawled mental health text data and transmits the preprocessed data to the mental health text data fusion unit; the preprocessing includes word segmentation, part-of-speech tagging, entity disambiguation and data fusion.
4. A mental health question-answering system based on knowledge graph according to claim 1, characterized in that: The intention recognition module uses the Aho-Corasick algorithm to perform rule matching through predefined question types to obtain intention recognition results.
5. A mental health question-answering system based on knowledge graph according to claim 1, characterized in that: The entity recognition module uses a combination model BERT+BiLSTM+CRF constructed by a pre-trained model, a bidirectional long short-term memory network and a conditional random field model to perform named entity recognition and obtain entity recognition results; the combination model BERT+BiLSTM+CRF includes an input layer, a pre-training layer, a feature extraction layer, a decoding layer and an output layer; The input layer is used to perform preliminary preprocessing on the query text to obtain an output result, and use the obtained output result as the input of the pretraining layer, wherein the preliminary preprocessing includes Chinese word segmentation and data cleaning; The pre-training layer uses the BERT model to map the sentences of the output results into word vectors as input to the feature extraction layer; The feature extraction layer uses a BiLSTM model to extract features from the word vectors, and passes the extracted sequence features to the decoding layer; The decoding layer uses a conditional random field model to decode the sequence features output by the feature extraction layer and filter out the label prediction results; The output layer presents the label prediction results in the form of a dictionary for each entity and its corresponding category and location information as an entity recognition result.
6. A mental health question-answering method based on knowledge graph, characterized in that: A mental health question-answering system based on a knowledge graph as described in any one of claims 1 to 5, comprising the following steps: S1. Get the query text entered by the user; S2. Perform intent recognition based on rule matching and entity recognition based on the combined model BERT+BiLSTM+CRF on the query text to obtain parsing results; S3. Performing an associated query based on the parsing result and the pre-built mental health knowledge graph to obtain a query result or a default result; S4. Display the query result or the default result.
7. A method for answering questions about mental health based on knowledge graph according to claim 6, characterized in that: In S2, the intent is extracted from the query text by intent recognition to obtain an intent recognition result; and the entity is extracted from the query text by entity recognition to obtain an entity recognition result.
8. A method for answering questions about mental health based on knowledge graph according to claim 7, characterized in that: The specific contents of S3 include: S31. Storing entities, attributes and relationships set in the mental health ontology library in the neo4j graph database; S32. Match the intent recognition results and entity recognition results identified from the query text with the entities in the neo4j graph database to obtain the query target entities and relationships; S33. Generate corresponding Cypher query statements based on the query target entities and relationships matched in S32, perform queries in the neo4j graph database, and return query results.
9. A method for answering questions about mental health based on knowledge graph according to claim 6, characterized in that: The specific steps to pre-build a mental health knowledge graph are: S51. Construct a mental health ontology library as a graph framework and set the categories, attributes and relationships of the mental health ontology; S52. Crawl mental health text data on web pages; S53. Select one of the websites from which the mental health text data is obtained as an alignment standard, perform entity alignment and ontology fusion on the mental health text data obtained from other websites and the mental health text data corresponding to the alignment standard, complete data fusion, and obtain fused data; S54. Import the fused data into the mental health ontology library for storage and generate a mental health knowledge graph.
10. A method for answering questions about mental health based on knowledge graph according to claim 9, characterized in that: S52 also includes preprocessing the crawled mental health text data, including word segmentation and part-of-speech tagging of semi-structured data and unstructured data in the mental health text data.
Citation Information
Cited By
Question and answer method based on thinking chain and intelligent agent and ChatBI system
CN120012760A
