A method for constructing an intelligent question-answering system based on water conservancy knowledge graph
By acquiring and processing user water conservancy consultation data, we build an intelligent question and answer system based on the water conservancy knowledge graph, which solves the problem that traditional systems cannot give precise answers and sort out complex relationships, achieving high-quality water conservancy consultation responses and improving user experience.
Patent Information
- Application Number
- CN202411026061.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-07-30
AI Technical Summary
The traditional intelligent question and answer system based on the water conservancy knowledge graph cannot give precise answers, and it is difficult to accurately sort out complex relationships, and cannot effectively handle users' water conservancy consultation questions.
By obtaining users' online water conservancy consultation data, we perform part-of-speech tagging and deep semantic fusion entity recognition, classify questions, build regular and complex question matching templates, and use the water conservancy knowledge graph for in-depth response processing, design a question and answer response mechanism, and build an intelligent question and answer system.
It improves the accuracy of system answers and the ability to sort out complex relationships, provides high-quality, instant answers and solutions, meets users' diverse needs for water conservancy issues, and enhances user experience and the professionalism and credibility of the system.
Smart Images

Figure CN118551027B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of constructing an intelligent question-answering system, and in particular to a method for constructing an intelligent question-answering system based on a water conservancy knowledge graph. Background Art
[0002] With the continuous advancement of information technology, water conservancy is becoming increasingly modernized. In this process, the water conservancy field has accumulated a huge amount of multi-source heterogeneous information, which is massive, dynamic, multi-source and complex. In order to promote the development of smart water conservancy, we are faced with a core problem: how to accurately extract the required information from these complex water conservancy data and give accurate answers to users' questions. In the past, we mainly relied on search engines to obtain information, but this method often only provides a series of relevant documents, and users need to read and extract answers by themselves. Knowledge graphs, as a semantic network that expresses entities, concepts and their relationships, are gradually gaining favor in academia and industry with their flexible query functions and excellent visualization effects. It can clearly display complex factual relationships in the form of entity-relationship-entity triples. In recent years, the widespread application of knowledge graphs has provided high-quality knowledge base support for intelligent question-answering systems and promoted the development of question-answering systems. Although knowledge graphs have been deeply applied in many fields, their application in the field of water conservancy is still insufficient. A traditional method for constructing an intelligent question-answering system based on water conservancy knowledge graphs has the problem of being unable to give accurate answers and accurately combing complex relationships. Summary of the invention
[0003] Based on this, it is necessary to provide a method for constructing an intelligent question-answering system based on a water conservancy knowledge graph to solve at least one of the above technical problems.
[0004] A method for constructing an intelligent question-answering system based on a water conservancy knowledge graph comprises the following steps:
[0005] Step S1: obtaining a user online water conservancy consultation dataset; performing part-of-speech tagging on the user online water conservancy consultation dataset to obtain user online consultation part-of-speech data; performing deep semantic fusion entity recognition on the user online consultation part-of-speech data to obtain consultation semantic fusion entity data;
[0006] Step S2: Classify the consulting questions between different consulting entities in the user online water conservancy consulting dataset according to the consulting semantic fusion entity data to obtain water conservancy consulting entity question classification data; link the question target attributes of the water conservancy consulting entity question classification data to obtain question target attribute link data; construct a question matching template for the user online water conservancy consulting dataset according to the question target attribute link data to obtain a conventional target question matching template and a complex target question matching template;
[0007] Step S3: performing water conservancy knowledge deep response processing on the conventional target problem matching template and the complex target problem matching template to obtain conventional problem water conservancy knowledge feature response data and complex problem water conservancy knowledge feature response data;
[0008] Step S4: Design a question-and-answer response mechanism based on the water conservancy knowledge feature response data for routine questions and the water conservancy knowledge feature response data for complex questions to obtain a water conservancy knowledge question-and-answer response mechanism; construct an intelligent question-and-answer system based on the water conservancy knowledge question-and-answer response mechanism to obtain a water conservancy knowledge intelligent question-and-answer system.
[0009] The present invention first ensures that sufficient online consultation data is obtained, which includes questions, descriptions or needs of users on water conservancy related issues. Part-of-speech tagging is a basic step in natural language processing. By marking the part of speech of each word (such as noun, verb, adjective, etc.), the grammatical structure and meaning of the sentence can be better understood. Part-of-speech tagging in water conservancy consultation data helps to analyze the role and relationship of each word in the sentence. This step involves more advanced semantic analysis and entity recognition. Deep semantic fusion can combine the capabilities of language models (such as GPT) to understand the deeper meaning of sentences, including logical relationships between words, contextual inference, etc. Entity recognition is to identify specific entities in sentences, such as place names, names, professional terms, etc. Combined with the output of the above steps, entity recognition data after deep semantic fusion is obtained. These data may include identified key entities (such as water conservancy projects, watersheds, water resources management, etc.), associations between entities (such as the relationship between problems and solutions), and semantic roles of entities (such as subject, object, etc.). By consulting semantic fusion entity data, the system can classify user consulting questions. These classifications can classify consulting questions into specific categories based on different water conservancy entities (such as water conservancy projects, water resources management, irrigation systems, etc.). Linking questions to specific target attributes can be understood as mapping the user's consulting questions to relevant specific attributes or features. For example, linking the question "How to improve the irrigation efficiency in a certain area?" to the specific target attribute "methods to improve irrigation efficiency". According to the question target attribute linking data, the system can build routine and complex question matching templates. These templates can be predefined structured question forms for quickly identifying and processing users' common questions, and can also handle more complex and personalized consulting needs. The water conservancy knowledge feature response data for routine questions is a response data set constructed for general and common water conservancy questions. These data provide detailed and accurate answers to typical water conservancy questions. The water conservancy knowledge feature response data for complex questions is a response data set constructed for more challenging and changeable water conservancy questions. These data contain more in-depth analysis, highly professional answers, or answers that require comprehensive knowledge from multiple aspects. By processing the water conservancy knowledge feature response data for routine and complex questions, the system can provide in-depth and comprehensive answers. This is not just a simple provision of information, but a professional answer to different types of questions to meet users' needs for various water conservancy issues. The response data shows the system's deep understanding and knowledge accumulation in the field of water conservancy. This in-depth display not only improves the recognition of the system in terms of professionalism and credibility, but also provides users with high-quality information services. For different types of questions, the system can distinguish and provide appropriate responses. This personalized response optimization enhances the user experience and enables users to solve their specific problems more quickly and effectively. Based on the response data in step S3, a response mechanism for water conservancy knowledge questions and answers is designed.This includes how to select appropriate response data based on the type and complexity of the user's question, and how to present the answer to the user in a structured and effective manner. Based on a well-designed response mechanism, an intelligent question-and-answer system for water conservancy knowledge is constructed. This system integrates all the aforementioned processing steps, can automatically handle users' water conservancy consulting questions, and provide high-quality, immediate answers and solutions. Therefore, the present invention is an optimization of a traditional method for constructing an intelligent question-and-answer system based on a water conservancy knowledge graph, which solves the problem that a traditional method for constructing an intelligent question-and-answer system based on a water conservancy knowledge graph is unable to give accurate answers and accurately sort out complex relationships, thereby improving the accuracy of the system's answers and the ability to accurately sort out complex relationships.
[0010] Preferably, step S1 comprises the following steps:
[0011] Step S11: obtaining a user's online water conservancy consultation data set;
[0012] Step S12: Performing syntactic structure analysis on the user online water conservancy consultation data set to obtain the user online consultation syntactic structure data;
[0013] Step S13: performing part-of-speech tagging on the user online water conservancy consultation dataset according to the user online consultation syntactic structure data to obtain the user online consultation part-of-speech data;
[0014] Step S14: semantically enhancing the user online water conservancy consultation dataset according to the user online consultation syntactic structure data and the user online consultation part-of-speech data to obtain the user online consultation semantic enhancement data;
[0015] Step S15: Use the BERT-BiLSTM-CRF model to perform deep semantic fusion entity recognition on the user online consultation semantic enhancement data and the user online consultation part-of-speech data to obtain consultation semantic fusion entity data.
[0016] By acquiring a large-scale online water conservancy consultation data set, the system of the present invention can establish a broad data foundation covering various types of water conservancy problems and needs, thereby improving the coverage of various types of problems. Syntactic structure analysis helps the system understand the relationship and grammatical structure between words in a sentence, ensuring that the system can accurately identify and analyze the role and semantics of each word in subsequent processing. Part-of-speech tagging enables the system to more accurately understand the role and meaning of each word in a sentence, thereby helping the system to more accurately capture the user's consulting intentions. Through semantic enhancement processing, the system can further improve its ability to understand user problems, better identify key information and context in the problem, and thus improve the effect of subsequent processing steps. Using the BERT-BiLSTM-CRF model for deep semantic fusion entity recognition, the system can efficiently and accurately identify key entities in sentences, such as professional terms, place names, etc., thereby providing a richer information basis for subsequent processing steps.
[0017] Preferably, step S15 comprises the following steps:
[0018] Step S151: using the BERT component in the BERT-BiLSTM-CRF model to perform consultation question request attribute recognition on the user online consultation semantic enhancement data and the user online consultation part-of-speech data to obtain consultation question request attribute data;
[0019] Step S152: extracting the bidirectional relationship between the question request and the consulting question request attribute data to obtain the bidirectional relationship data between the question request and the consulting question request;
[0020] Step S153: Eliminate invalid sequence feature data of the consulting question request attribute data according to the question request bidirectional relationship data to obtain valid sequence feature data of the question request;
[0021] Step S154: Perform deep semantic fusion entity recognition based on the question-request bidirectional relationship data and the question-request sequence feature valid data to obtain consultation semantic fusion entity data.
[0022] The present invention utilizes the BERT component in the BERT-BiLSTM-CRF model to process the semantic reinforcement data and part-of-speech data of the user's online consultation. The main purpose of this step is to identify the key attributes in the user's consultation, such as specific question types, demand background, etc. Through the BERT model, the system can accurately identify the key attributes in the user's question, thereby helping the system to better understand the user's specific needs. Identifying the request attributes of the question helps the system to deeply understand the user's intention, and provides a more accurate and targeted information basis for the subsequent processing steps. Based on the identified consultation question request attribute data, the system performs bidirectional relationship extraction. This step aims to capture the association and influence between the various attributes in the question, so as to construct a more complex and comprehensive problem description. Bidirectional relationship extraction helps the system understand the problem from multiple perspectives and further enrich the context and background information of the problem. Through relationship extraction, the system can comprehensively consider the interactive relationship between the various attributes in the question, and provide more comprehensive and accurate input data for subsequent processing. According to the question request bidirectional relationship data, the consultation question request attribute data is screened and optimized for the effectiveness of sequence features. This step is intended to ensure that the system only uses valid feature data that is beneficial to problem understanding. Removing invalid sequence features helps the system focus on the processing and analysis of key information, improving processing efficiency and accuracy. Optimized data can reduce misunderstandings or semantic ambiguities introduced by data noise, thereby improving the accuracy of the system's answers and user satisfaction. Combining the question-request bidirectional relationship data with the optimized sequence feature valid data, the system performs deep semantic fusion entity recognition. This step can accurately identify various entities in the question, such as professional terms, place names, etc. Deep semantic fusion entity recognition ensures that the system not only understands the overall semantics of the question, but also accurately identifies and processes key entity information, making the system's answers more comprehensive and detailed. Through accurate entity recognition, the system can provide more professional and credible answers, thereby enhancing users' trust in the system and their user experience.
[0023] Preferably, removing invalid sequence features from the consulting question request attribute data according to the question request bidirectional relationship data comprises the following steps:
[0024] According to the bidirectional relationship data of the question request, attribute data of the consulting question request is injected into the bidirectional serialization of the attributes to obtain a bidirectional sequence of the question request attributes;
[0025] Perform dependency association identification on the bidirectional sequence of question request attributes to obtain bidirectional dependency association data of the question request;
[0026] The CRF layer in the BERT-BiLSTM-CRF model is used to iteratively collect training data for question-request bidirectional dependency association data to obtain question-request bidirectional dependency iterative training data;
[0027] The preset training error constraint model is used to eliminate invalid sequence features of question request bidirectional dependency iterative training data to obtain valid data of question request sequence features.
[0028] In this step of the present invention, according to the bidirectional relationship data of the question request, the system injects the attribute data of the consultation question request into a bidirectional serialization. This means that the system will establish a sequence of question attributes according to the bidirectional relationship of the question to capture the mutual influence and dependency between different attributes in the question. The bidirectional sequence of the injected question request attributes is subjected to dependency association identification. The purpose of this step is to analyze and identify the association between the various attributes, including which attributes are of great significance to solving the problem, and the interaction pattern between them. Using the CRF layer in the BERT-BiLSTM-CRF model, the system performs iterative training data collection on the bidirectional dependency association data of the question request. The CRF layer is used here to model and learn sequence labeling tasks to identify and capture the key dependency patterns in the problem. Using the preset training error constraint model, the system performs invalid sequence feature elimination on the collected bidirectional dependency iterative training data of the question request. The key to this step is to filter and eliminate those sequence features that do not contribute significantly to the understanding and analysis of the problem according to the training error constraint of the model, thereby optimizing the quality and accuracy of the data.
[0029] Preferably, step S2 comprises the following steps:
[0030] Step S21: classifying the consultation questions between different consultation entities on the user online water conservancy consultation dataset according to the consultation semantic fusion entity data and the user online consultation part-of-speech data, and obtaining the water conservancy consultation entity question classification data;
[0031] Step S22: Perform tone difference perception on the water conservancy consulting entity question classification data to obtain consulting question tone difference perception data;
[0032] Step S23: linking the water conservancy consulting entity question classification data with question target attributes according to the consulting question tone difference perception data to obtain question target attribute link data;
[0033] Step S24: constructing a question matching template for the user's online water conservancy consultation dataset according to the question target attribute link data to obtain a conventional target question matching template and a complex target question matching template.
[0034] The present invention utilizes the consultation semantic fusion entity data and the part-of-speech data of the user's online consultation, and the system classifies the questions in the water conservancy consultation data set. The goal of this step is to classify the consultation questions into different water conservancy consultation entity classifications according to the entity and part-of-speech features in the question. By semantically fusing entity data and part-of-speech information, the system can accurately assign questions to corresponding water conservancy consultation entity classifications, thereby improving the accuracy and efficiency of question classification. The classified questions enable the system to better understand the specific consultation content of the user, providing a clearer and more targeted data basis for subsequent processing steps. For the classified water conservancy consultation entity question data, the system performs tone difference perception processing. This step aims to analyze and understand the tone features expressed in the question, such as questions, statements, commands, etc. Through tone difference perception, the system can more deeply understand the emotions and attitudes behind the user's question, so as to better adjust and optimize the answer strategy. Understanding the tone of the question helps the system interact with the user in a more friendly and appropriate way, and improve the user's satisfaction and trust in the system. According to the tone difference perception data, the system links the question target attribute to the water conservancy consultation entity question classification data. The purpose of this step is to establish an effective link between the question and the corresponding target attribute or question type for subsequent question matching and answer construction. Through the target attribute link, the system can accurately associate the question with a specific question type or processing flow, thereby ensuring the accuracy and completeness of the question answer. The linked data helps the system provide more personalized and effective problem processing and solutions based on the specific attributes and demand characteristics of the question. Based on the question target attribute link data, the system constructs conventional target question matching templates and complex target question matching templates for the user's online water conservancy consultation data set. These templates are used for subsequent question matching and answer generation in the system. The constructed matching templates can help the system classify and match questions raised by users more quickly, thereby improving the efficiency and speed of problem processing. The templated problem processing method can ensure that the system maintains consistent response and processing standards among different users, enhancing user experience and satisfaction.
[0035] Preferably, step S23 includes the following steps:
[0036] Step S231: performing sentiment tendency analysis on the consultation question tone difference perception data to obtain consultation sentiment tendency data;
[0037] Step S232: performing water conservancy entity association analysis on the water conservancy consulting entity question classification data according to the consulting sentiment tendency data and the consulting question tone difference perception data to obtain water conservancy entity question tone association data;
[0038] Step S233: extracting water conservancy entity context dependency from the water conservancy entity question tone association data to obtain water conservancy entity context dependency data;
[0039] Step S234: performing non-monotonic logic processing according to the water conservancy entity context-dependent data to obtain context-dependent non-monotonic logic data;
[0040] Step S235: performing first-order logic quantization processing on the water conservancy entity context-dependent data according to the context-dependent non-monotonic logic data to obtain first-order logic quantization data of the water conservancy entity;
[0041] Step S236: linking the water conservancy consulting entity question classification data with question target attributes according to the context-dependent non-monotonic logic data and the water conservancy entity first-order logic quantification data to obtain question target attribute linking data.
[0042] The present invention performs sentiment tendency analysis on the perception data of tone difference of consulting questions. The purpose of this step is to identify and understand the sentiment tendency in the questions, such as positive, negative or neutral. Analyzing the sentiment tendency in consulting questions helps the system to more accurately understand the user's emotional state and the intention behind the question, so as to better adjust the answer strategy and tone. According to the sentiment tendency data, the system can adjust the response method in a personalized way to make it more in line with the user's emotional needs and improve user experience and satisfaction. Based on the consulting sentiment tendency data and the perception data of tone difference, the system performs association analysis on the classification data of water conservancy consulting entity questions. This step aims to establish the association relationship between the tone of the question and the specific water conservancy entity. Through the tone association data, the system can more accurately associate the question with the relevant water conservancy entity, so as to effectively locate the processing direction and content of the problem. The association analysis helps the system to deeply explore and understand the problems and needs in the specific water conservancy field, and improves the ability and depth of the system to handle complex problems. The system extracts and analyzes the contextual dependencies in the question according to the tone association data of the water conservancy entity question. This includes understanding the logical and semantic relationships between entities in the question. Extracting context-dependent data helps the system understand the logical relationship between entities in the question more clearly, thereby improving the consistency and accuracy of question understanding and answering. Understanding context-dependent relationships can help the system deeply analyze and parse complex problems, thereby providing more in-depth and comprehensive answers or solutions. Based on the water conservancy entity context-dependent data, the system performs non-monotonic logic processing. The purpose of this step is to deal with the complex logical relationships and ambiguity in the question. Non-monotonic logic processing helps the system avoid ambiguity and reasoning errors when dealing with complex problems, and improves the system's logical reasoning ability in complex scenarios. Processing non-monotonic logic enables the system to more comprehensively consider and analyze multiple possibilities in the question, thereby providing more comprehensive and accurate information answers. Based on the context-dependent non-monotonic logic data, the system performs first-order logic quantification processing on the water conservancy entity context-dependent data. This step aims to quantify complex logical relationships into formalized logical expressions. Logical quantification processing allows the system to express the logical relationships in the question in a more structured and formalized way, improving the efficiency and accuracy of the system in dealing with complex problems. The quantified logical expression is convenient for computer processing and reasoning, which speeds up the speed of the system generating answers and the response efficiency. Based on the context-dependent non-monotonic logic data and the first-order logic quantitative data of water conservancy entities, the system links the question target attributes to the water conservancy consulting entity question classification data. This step links the question with the specific question type or entity attribute, providing a basis for subsequent question matching and answer construction. The question target attribute linking data ensures that the system can accurately link the question with the corresponding question type or entity attribute, improving the pertinence and effectiveness of the question answering. The linked data helps the system to personalize and optimize the answer strategy according to the specific question type or attribute characteristics, thereby improving user experience and satisfaction.
[0043] Preferably, step S24 includes the following steps:
[0044] Step S241: using the preset question format parsing recognition model and question target attribute link data to divide the user's online water conservancy consultation data set into parsing difficulty categories, and obtain conventional water conservancy consultation question parsing data and complex water conservancy consultation question parsing data;
[0045] Step S242: extracting water conservancy query elements from the conventional water conservancy consultation question parsing data to obtain water conservancy conventional query element data;
[0046] Step S243: using cypher query statements to match the water conservancy general query element data, to obtain a water conservancy general query statement;
[0047] Step S244: constructing a conventional problem matching template according to the conventional water conservancy query statement to obtain a conventional target problem matching template;
[0048] Step S245: construct a complex problem matching template for the complex water conservancy consultation question parsing data to obtain a complex target problem matching template.
[0049] The present invention uses a preset question format parsing recognition model to identify and link the data of question target attributes. This includes classifying the questions in the online water conservancy consultation data set into two categories: regular and complex. Through the preset question format, the model can accurately judge the complexity of each question, so as to better handle different types of consultation problems. Linking the question target attributes with the data set enables subsequent steps to more effectively use this information for further processing. Once the questions are classified as routine water conservancy consultations, the next step is to extract routine water conservancy query element data from these questions, including determining the key information and elements involved in the questions. This information is necessary for subsequent queries and responses, and converting complex natural language questions into structured query elements, which helps to automate and understand the subsequent steps. Using Cypher query statements, this step converts routine water conservancy query element data into actual query statements. The use of Cypher statements ensures efficient access and query of data storage, thereby speeding up response speed. By generating standardized query statements, the system can more automatically perform retrieval and processing of water conservancy data. In these two steps, target question matching templates are constructed for routine and complex water conservancy consultation questions respectively. The use of matching templates can ensure the system's accurate response to common and complex questions, improve user experience, and the construction of templates allows the system to be more flexible and efficient when handling new consulting questions.
[0050] Preferably, constructing a complex problem matching template for complex water conservancy consultation question parsing data includes the following steps:
[0051] The two-dimensional matrix of complex water conservancy consultation question analysis data is constructed to obtain the two-dimensional matrix of complex water conservancy consultation question;
[0052] The structural similarity of the two-dimensional matrix of complex water conservancy consultation questions is calculated to obtain the structural similarity data of the two-dimensional matrix;
[0053] According to the two-dimensional matrix structure similarity data, convolution calculation is performed on the two-dimensional matrix of complex water conservancy consultation questions to obtain the question matrix structure similarity convolution data;
[0054] Perform question matrix feature pooling processing on the question matrix structural similarity convolution data to obtain question matrix feature pooling data;
[0055] Perform overfitting optimization processing based on the question matrix structural similarity convolution data and the question matrix feature pooling data to obtain the question matrix overfitting optimization data;
[0056] A complex question matching template is constructed based on the question matrix structural similarity convolution data, question matrix feature pooling data and matrix overfitting optimization data to obtain a complex target question matching template.
[0057] The present invention converts the parsed data of complex water conservancy consulting questions into the form of a two-dimensional matrix. This structured representation can better express the semantics and logical relationships in the questions. The two-dimensional matrix can clearly show the relationship between different elements in the questions, which is helpful for the in-depth processing and analysis of subsequent steps. The matrix form enables the computer to more effectively process and analyze complex semantic structures, improving the processing efficiency and response speed of the system. By calculating the structural similarity of the two-dimensional matrix of the questions, the degree of structural similarity between different questions is determined. The structural similarity data can help the system accurately judge the similarities and differences between complex questions, so as to more accurately allocate problem handling strategies. Based on the structural similarity, the system can better learn and adjust the model to adapt to consulting questions of different types and complexities. The convolution calculation is performed using the two-dimensional matrix structural similarity data to further deepen the understanding and analysis of the question structure. The convolution operation helps to extract key structural features from the question matrix, enhancing the system. The system can more accurately understand the semantic associations between different parts of the question through convolution calculations, further optimize the accuracy and depth of question parsing, and perform feature pooling on the convolution data of the question matrix structure similarity to reduce data complexity and extract the most critical features. Feature pooling helps to convert complex structural data into a higher-level abstract feature representation, simplifying the complexity of subsequent processing steps. The refined feature representation enables the model to more efficiently match questions and build templates, improving the overall performance and response speed of the system. Based on the convolution data of the question matrix structure similarity and feature pooling data, overfitting optimization is performed to balance the complexity and generalization ability of the model. Overfitting optimization ensures that the model will not fall into overfitting when dealing with complex problems, maintaining the generalization ability and stability of the model. The optimized data processing can more reliably support the parsing and response of complex problems, improving the user satisfaction and trust of the system. Based on convolution data, feature pooling data, and overfitting optimization data, a matching template suitable for complex problems is constructed for the system's question parsing and response. The constructed matching template can effectively guide the system in problem analysis and answer generation when dealing with complex problems, improving the accuracy and efficiency of problem matching. Through refined template construction, the system can provide more accurate and comprehensive answers, enhancing the user experience and satisfaction during use.
[0058] Preferably, step S3 comprises the following steps:
[0059] Step S31: using a preset water conservancy knowledge graph to perform water conservancy knowledge deep response processing on conventional target problem matching templates and complex target problem matching templates to obtain conventional problem water conservancy knowledge response data and complex problem water conservancy knowledge response data;
[0060] Step S32: extracting characteristic responses from the conventional water conservancy knowledge response data and the complex water conservancy knowledge response data respectively, to obtain the conventional water conservancy knowledge characteristic response data and the complex water conservancy knowledge characteristic response data.
[0061] The present invention uses a preset water conservancy knowledge graph to perform deep response processing on conventional target problem matching templates and complex target problem matching templates. The water conservancy knowledge graph contains rich domain knowledge and relationships, which can help the system understand the problem background and context. Through deep response processing, the system can generate water conservancy knowledge response data for different types of problems, thereby improving the system's ability to understand and answer complex problems. According to the different nodes and relationships of the knowledge graph, the system can generate diversified responses, covering various problem situations, and enhancing the adaptability and practicality of the system. Feature responses are extracted and processed for conventional problem water conservancy knowledge response data and complex problem water conservancy knowledge response data. During the feature response extraction process, the system can identify and extract key information and features in the problem response, such as important water conservancy concepts, relevant technical details, etc. The extracted feature responses can effectively aggregate and integrate water conservancy knowledge, thereby forming a more comprehensive and accurate answer to the problem. The refined processing of feature responses makes the responses generated by the system more in-depth and accurate, and improves the user's trust and satisfaction with the system response.
[0062] Preferably, step S31 includes the following steps:
[0063] Step S311: using a preset water conservancy knowledge graph to perform graph node data similarity matching on a conventional target problem matching template and a complex target problem matching template, to obtain conventional problem node similarity matching data and complex problem node similarity matching data;
[0064] Step S312: performing association result similarity data iteration on the common problem node similarity matching data and the complex problem node similarity matching data respectively, to obtain common problem result similarity iteration data and complex problem result similarity iteration data;
[0065] Step S313: constructing triple tables for the similar iteration data of the conventional problem results and the similar iteration data of the complex problem results respectively, to obtain a similar iteration triple table of the conventional problem results and a similar iteration triple table of the complex problem results;
[0066] Step S314: performing semantic relationship dynamic query optimization according to the similar iterative triple table of conventional question results and the similar iterative triple table of complex question results, and obtaining conventional question result query optimization data and complex question result query optimization data;
[0067] Step S315: sorting the regular problem result query optimization data and the complex problem result query optimization data by result repetition ratio, respectively, to obtain regular result repetition ratio sorting data and complex result repetition ratio sorting data;
[0068] Step S316: Optimize and adjust the word order output according to the repetition ratio sorting data of the conventional results and the repetition ratio sorting data of the complex results to obtain the water conservancy knowledge response data of the conventional problems and the water conservancy knowledge response data of the complex problems.
[0069] The present invention uses a water conservancy knowledge graph to perform similarity matching on graph nodes in conventional and complex target problem matching templates. Node similarity matching data can help the system accurately identify and match key information associated with nodes in the knowledge graph in the problem template, ensuring the accuracy and completeness of problem resolution. Through node similarity matching, the system can more deeply understand the context and background of the problem, thereby more effectively generating relevant response data. Based on the graph node similarity, the system can quickly screen and match suitable knowledge fragments, thereby improving the processing efficiency and response speed of problem resolution. For conventional and complex problem node similarity matching data, iterative processing of associated result similarity data is performed. Iterative processing can gradually enrich the processing results of the problem, including more relevant water conservancy knowledge and practical information, thereby improving the depth and breadth of problem resolution. Through iteration, the system can integrate knowledge of different levels and details to generate more comprehensive and diverse problem answers to meet the diverse needs of users. Iterative processing helps to ensure the logical and semantic consistency of the generated answers, and improves the uniformity and reliability of the system response. According to the similarity iterative data of the conventional and complex problem results, a corresponding triple table is constructed to organize and manage the knowledge relationship in problem resolution in a more systematic way. The triple table can express the key knowledge and semantic relationships in problem analysis in a structured way, so that the system can understand and handle complex problems more clearly. The structured triple table helps the system to efficiently manage and retrieve a large amount of water conservancy knowledge data, improving the information processing and management efficiency of the system. Through the triple table, the system can more accurately perform dynamic query and analysis of semantic relationships, thereby optimizing the accuracy and depth of problem analysis. Based on the similarity of the results of conventional and complex problems, the triple table is iterated to optimize the dynamic query of semantic relationships. Dynamic query optimization ensures that the system can obtain and apply the latest water conservancy knowledge and semantic relationships in real time, improving the real-time and accuracy of problem analysis. The optimization process can dynamically update and optimize the query and application process of water conservancy knowledge according to user needs and system learning feedback, maintaining the adaptability and continuous improvement ability of the system. Through query optimization, the system can quickly respond to complex problems, improving user experience and problem solving efficiency. The query optimization data of conventional and complex problem results is sorted according to the repetition ratio of the results. The sorting process can ensure the logical and semantic consistency of the response results generated by the system, improving the stability and reliability of the system response. By sorting by proportion, the system can prioritize and display the most relevant and representative answers to questions, improving user satisfaction and trust in the answers. The sorting process helps to screen and display the most effective information content, avoid duplicate or irrelevant content, and optimize the quality and practicality of the information output by the system. Based on the repetition ratio sorting data of routine and complex results, the word order output is optimized. The word order optimization can make the responses generated by the system clearer and easier to understand, improving the user's acceptance and understanding of the answers to questions.By optimizing the word order, the system can better match the user's language habits and expressions, enhancing the naturalness of the user experience and interaction. Optimization and adjustment can ensure that the answers generated by the system are more fluent and natural in language expression, while maintaining the accuracy and completeness of the question analysis.
[0070] The beneficial effects of the present invention are as follows: first, sufficient online consultation data is obtained, which includes questions, descriptions or demands of users on water conservancy-related issues. Part-of-speech tagging is a basic step in natural language processing. By marking the part of speech of each word (such as noun, verb, adjective, etc.), the grammatical structure and meaning of the sentence can be better understood. Part-of-speech tagging in water conservancy consultation data helps to analyze the role and relationship of each word in the sentence. This step involves more advanced semantic analysis and entity recognition. Deep semantic fusion can combine the capabilities of language models (such as GPT) to understand the deeper meaning of sentences, including logical relationships between words, contextual inference, etc. Entity recognition is to identify specific entities in sentences, such as place names, names, professional terms, etc. Combined with the output of the above steps, entity recognition data after deep semantic fusion is obtained. These data may include identified key entities (such as water conservancy projects, watersheds, water resources management, etc.), associations between entities (such as the relationship between problems and solutions), and semantic roles of entities (such as subjects, objects, etc.). By consulting semantic fusion entity data, the system can classify user consulting questions. These classifications can classify consulting questions into specific categories based on different water conservancy entities (such as water conservancy projects, water resources management, irrigation systems, etc.). Linking questions to specific target attributes can be understood as mapping the user's consulting questions to relevant specific attributes or features. For example, linking the question "How to improve the irrigation efficiency in a certain area?" to the specific target attribute "methods to improve irrigation efficiency". According to the question target attribute linking data, the system can build routine and complex question matching templates. These templates can be predefined structured question forms for quickly identifying and processing users' common questions, and can also handle more complex and personalized consulting needs. The water conservancy knowledge feature response data for routine questions is a response data set constructed for general and common water conservancy questions. These data provide detailed and accurate answers to typical water conservancy questions. The water conservancy knowledge feature response data for complex questions is a response data set constructed for more challenging and changeable water conservancy questions. These data contain more in-depth analysis, highly professional answers, or answers that require comprehensive knowledge from multiple aspects. By processing the water conservancy knowledge feature response data for routine and complex questions, the system can provide in-depth and comprehensive answers. This is not just a simple provision of information, but a professional answer to different types of questions to meet users' needs for various water conservancy issues. The response data shows the system's deep understanding and knowledge accumulation in the field of water conservancy. This in-depth display not only improves the recognition of the system in terms of professionalism and credibility, but also provides users with high-quality information services. For different types of questions, the system can distinguish and provide appropriate responses. This personalized response optimization enhances the user experience and enables users to solve their specific problems more quickly and effectively. Based on the response data in step S3, a response mechanism for water conservancy knowledge questions and answers is designed.This includes how to select appropriate response data based on the type and complexity of the user's question, and how to present the answer to the user in a structured and effective manner. Based on a well-designed response mechanism, an intelligent question-and-answer system for water conservancy knowledge is constructed. This system integrates all the aforementioned processing steps, can automatically handle users' water conservancy consulting questions, and provide high-quality, immediate answers and solutions. Therefore, the present invention is an optimization of a traditional method for constructing an intelligent question-and-answer system based on a water conservancy knowledge graph, which solves the problem that a traditional method for constructing an intelligent question-and-answer system based on a water conservancy knowledge graph is unable to give accurate answers and accurately sort out complex relationships, thereby improving the accuracy of the system's answers and the ability to accurately sort out complex relationships. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 It is a schematic diagram of the steps of a method for constructing an intelligent question-answering system based on a water conservancy knowledge graph;
[0072] Figure 2 for Figure 1 Detailed implementation steps of step S2 in the flowchart;
[0073] Figure 3 for Figure 1 Detailed implementation steps of step S3 in FIG.
[0074] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0075] The technical method of the present invention is described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are 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 technicians in this field without creative work are within the scope of protection of the present invention.
[0076] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor methods and / or microcontroller methods.
[0077] It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.
[0078] To achieve this, please refer to Figures 1 to 3 , a method for constructing an intelligent question answering system based on a water conservancy knowledge graph, comprising the following steps:
[0079] Step S1: obtaining a user online water conservancy consultation dataset; performing part-of-speech tagging on the user online water conservancy consultation dataset to obtain user online consultation part-of-speech data; performing deep semantic fusion entity recognition on the user online consultation part-of-speech data to obtain consultation semantic fusion entity data;
[0080] Step S2: Classify the consulting questions between different consulting entities in the user online water conservancy consulting dataset according to the consulting semantic fusion entity data to obtain water conservancy consulting entity question classification data; link the question target attributes of the water conservancy consulting entity question classification data to obtain question target attribute link data; construct a question matching template for the user online water conservancy consulting dataset according to the question target attribute link data to obtain a conventional target question matching template and a complex target question matching template;
[0081] Step S3: performing water conservancy knowledge deep response processing on the conventional target problem matching template and the complex target problem matching template to obtain conventional problem water conservancy knowledge feature response data and complex problem water conservancy knowledge feature response data;
[0082] Step S4: Design a question-and-answer response mechanism based on the water conservancy knowledge feature response data for routine questions and the water conservancy knowledge feature response data for complex questions to obtain a water conservancy knowledge question-and-answer response mechanism; construct an intelligent question-and-answer system based on the water conservancy knowledge question-and-answer response mechanism to obtain a water conservancy knowledge intelligent question-and-answer system.
[0083] In the embodiment of the present invention, reference Figure 1 The above is a schematic diagram of the steps of a method for constructing an intelligent question-answering system based on a water conservancy knowledge graph of the present invention. In this example, the method for constructing an intelligent question-answering system based on a water conservancy knowledge graph includes the following steps:
[0084] Step S1: obtaining a user online water conservancy consultation dataset; performing part-of-speech tagging on the user online water conservancy consultation dataset to obtain user online consultation part-of-speech data; performing deep semantic fusion entity recognition on the user online consultation part-of-speech data to obtain consultation semantic fusion entity data;
[0085] In an embodiment of the present invention, first, a platform is constructed for collecting user online consultation data. This platform can be a web page or mobile application with interactive functions, in which users can submit consultations on water conservancy issues. The platform stores data through a back-end database, and commonly used database technologies such as MySQL, MongoDB, etc. are applicable. To ensure the diversity and extensiveness of the data, the time period for data collection should cover at least one complete water conservancy cycle, such as one year, to obtain comprehensive seasonal changes and consultation hotspot data. After obtaining the original data set, natural language processing tools are used to perform part-of-speech tagging on the text data. Commonly used tools include Stanford NLP, NLTK (Natural Language Toolkit) and SpaCy. Taking SpaCy as an example, first, a pre-trained language model needs to be loaded, such as a Chinese model (zh_core_web_sm), and then the model is used to process each consultation text and mark the part of speech of each word. This step is implemented by looping through each record in the data set and calling the annotation function of the model. The final output is the part-of-speech information of each word in each consultation text, which is saved in a structured data format, such as JSON or CSV file. After completing the part-of-speech tagging, the next step is to perform deep semantic fusion entity recognition. This step aims to extract entities with specific meanings from the text, such as water conservancy facility names, geographical locations, technical terms, etc. The deep semantic fusion method combines word vectors and contextual information. Commonly used tools include BERT (Bidirectional Encoder Representations from Transformers) and ERNIE (Enhanced Representation through Knowledge Integration). Taking BERT as an example, the labeled data is first preprocessed to convert the text into an input format acceptable to the BERT model. Then, the BERT model is used to encode the text to generate a context vector representation of each word. The encoded text is subjected to entity recognition through a pre-trained named entity recognition (NER) model, and the output result contains the category and location of each entity. The identified entity data can be stored in a database or structured file for subsequent analysis and processing. Through the above steps, the final consultation semantic fusion entity data is a structured result set containing key entity information in the user's online water conservancy consultation text. These data can be further used to build water conservancy knowledge graphs, optimize the performance of question-answering systems, etc. For example, if a consultation involves "flood control measures in the Yangtze River Basin", the deep semantic fusion entity recognition process will identify "Yangtze River Basin" as a geographical entity and "flood control measures" as a technical term. In this way, the system can accurately match the corresponding knowledge items based on these entity information, thereby providing more accurate and effective answers.
[0086] Step S2: Classify the consulting questions between different consulting entities in the user online water conservancy consulting dataset according to the consulting semantic fusion entity data to obtain water conservancy consulting entity question classification data; link the question target attributes of the water conservancy consulting entity question classification data to obtain question target attribute link data; construct a question matching template for the user online water conservancy consulting dataset according to the question target attribute link data to obtain a conventional target question matching template and a complex target question matching template;
[0087] In an embodiment of the present invention, after obtaining the consultation semantic fusion entity data, a classification algorithm is used to classify the questions in the user's online water conservancy consultation data set. First, a classification label is constructed based on the extracted entities. For example, if the entities include "reservoir", "pumping station", "river management", etc., the consultation questions can be classified into different categories. Use machine learning algorithms such as SVM (support vector machine), Random Forest or deep learning models such as LSTM (long short-term memory network) for classification training. The training data includes consultation questions and their corresponding entity labels. After model training, the new consultation questions are classified to obtain the entity category to which each question belongs, and generate water conservancy consultation entity question classification data. This data contains questions and their corresponding classification labels, which are stored in a database or structured file for subsequent processing. After the classification is completed, the question target attribute is linked. This step is intended to associate the question with its target attribute, such as the specific problem attribute of the consultation. For example, a question classified as "reservoir" involves attributes such as "water level", "capacity", and "safety". Using predefined attribute sets and rule bases, questions are linked to corresponding target attributes by matching keywords and semantic analysis methods. Tools such as SpaCy and WordNet can be used for keyword matching and semantic analysis. Each question is associated with its target attribute to generate question target attribute link data. This data includes the question, its classification label and the corresponding target attribute, which is stored in a structured file or database to support the construction of subsequent question matching templates. Question matching templates are constructed using question target attribute link data. First, common patterns and structures in questions are analyzed to determine templates for regular target questions. For example, for consultations on "reservoirs", regular questions are "What is the water level of the reservoir?" and "What is the capacity of the reservoir?". Based on these common questions, regular target question matching templates are constructed, including question structure, key entities and target attributes. For complex target questions, situations involving multiple entities or complex logic in the question are analyzed to construct corresponding templates. For example, "What measures should be taken if the water level of the reservoir exceeds the safety line?" is a complex target question. When constructing templates, regular expressions or rule-based natural language processing methods are used to ensure that the templates can match diverse questions. Finally, the obtained regular target question matching templates and complex target question matching templates are stored in the system, supporting the intelligent question-answering system to accurately match and answer user inquiries.
[0088] Step S3: performing water conservancy knowledge deep response processing on the conventional target problem matching template and the complex target problem matching template to obtain conventional problem water conservancy knowledge feature response data and complex problem water conservancy knowledge feature response data;
[0089] In an embodiment of the present invention, after completing the construction of the conventional target question matching template and the complex target question matching template, deep response processing of water conservancy knowledge is performed. First, the water conservancy knowledge graph is used to perform response processing on each matching template. The water conservancy knowledge graph is constructed by a rich water conservancy knowledge base, including information such as water conservancy facilities, technical terms, and historical data. The graph is queried through a knowledge graph query language (such as SPARQL), and relevant water conservancy knowledge is retrieved according to the key entities and target attributes in the question template. For the conventional target question matching template, a query operation is performed to extract the corresponding knowledge features from the knowledge graph. For example, for the conventional question template "What is the water level of the reservoir?", the current or historical water level data is obtained by querying the reservoir entity and its water level attribute in the water conservancy knowledge graph. Using the query results, conventional question water conservancy knowledge feature response data is generated, including the question template and its corresponding knowledge feature information, and stored in a structured file or database. For the complex target question matching template, more in-depth knowledge processing is performed. For example, for the complex question template "What measures should be taken if the water level of the reservoir exceeds the safety line?", it is necessary to retrieve a variety of information about the reservoir safety line and emergency measures in the water conservancy knowledge graph. Through multiple query operations, combined with information such as reservoir water level, warning level and emergency plan, the knowledge feature response data of the complex question is comprehensively generated. The retrieval results are inferred using an inference engine (such as an OWL reasoner) to obtain the specific measures that should be taken. The complex question template and its corresponding multi-dimensional knowledge feature information are stored to facilitate the response of the subsequent intelligent question-answering system.
[0090] Step S4: Design a question-and-answer response mechanism based on the water conservancy knowledge feature response data for routine questions and the water conservancy knowledge feature response data for complex questions to obtain a water conservancy knowledge question-and-answer response mechanism; construct an intelligent question-and-answer system based on the water conservancy knowledge question-and-answer response mechanism to obtain a water conservancy knowledge intelligent question-and-answer system.
[0091] In the embodiment of the present invention, according to the input question, the question is classified using the previously constructed classifier to determine whether it belongs to a routine question or a complex question. According to the classification result, the corresponding matching template is selected. For routine questions, the corresponding knowledge features are directly extracted from the water conservancy knowledge feature response data of the routine question to generate a direct answer. For complex questions, the water conservancy knowledge feature response data of the complex question is combined, and a comprehensive answer is generated through multiple rounds of retrieval and reasoning. The expression of the answer is optimized by natural language generation technology to make it more natural and easy to understand. At the same time, a user feedback mechanism is designed to allow users to evaluate and suggest answers, thereby continuously optimizing the response mechanism of the question-answering system. The overall architecture of the system is designed, including modules such as the front-end user interface, the back-end server, the database, and the knowledge graph storage. The front end uses modern Web technologies such as HTML, CSS, and JavaScript, and the back end uses frameworks such as Node.js, Django, or Flask. The database uses a relational database such as MySQL or a non-relational database such as MongoDB for storage. Design and develop a user-friendly front-end interface to support functions such as user input, viewing answers, and submitting feedback. The interface should be simple and intuitive to provide a good user experience. Implement the question-and-answer logic on the backend, including processing user requests, calling classification and retrieval modules, generating answers, and returning them to the frontend. At the same time, optimize system performance to ensure stable operation under high concurrency. Perform comprehensive tests on the system, including functional testing, performance testing, and user experience testing, to ensure that the system has no major defects. After the test is completed, deploy the system to the production environment for user use. After deployment, perform daily monitoring and maintenance of the system, handle user feedback and system problems in a timely manner, and continuously optimize the performance and accuracy of the question-and-answer system.
[0092] Preferably, step S1 comprises the following steps:
[0093] Step S11: obtaining a user's online water conservancy consultation data set;
[0094] Step S12: Performing syntactic structure analysis on the user online water conservancy consultation data set to obtain the user online consultation syntactic structure data;
[0095] Step S13: performing part-of-speech tagging on the user online water conservancy consultation dataset according to the user online consultation syntactic structure data to obtain the user online consultation part-of-speech data;
[0096] Step S14: semantically enhancing the user online water conservancy consultation dataset according to the user online consultation syntactic structure data and the user online consultation part-of-speech data to obtain the user online consultation semantic enhancement data;
[0097] Step S15: Use the BERT-BiLSTM-CRF model to perform deep semantic fusion entity recognition on the user online consultation semantic enhancement data and the user online consultation part-of-speech data to obtain consultation semantic fusion entity data.
[0098] In an embodiment of the present invention, an online platform is established to collect user consultation data on water conservancy issues. This platform can be a website or a mobile application, and users can enter questions through a text box. The consultation data is stored in a database, and database technologies such as MySQL or MongoDB are used to ensure the security and efficient access of the data. The time span of data collection should be long enough to cover different seasons and water conservancy events to ensure the diversity and comprehensiveness of the data, and the collected user consultation data is analyzed for syntactic structure using natural language processing tools. Select tools such as Stanford Parser or SpaCy to perform syntactic parsing on each consultation text. The parsing results include the syntactic tree structure of the sentence, and the syntactic components such as the subject, predicate, and object are marked. These syntactic structure data are stored in structured files, such as JSON or XML, for subsequent processing. Part-of-speech tagging is performed based on the parsed syntactic structure data. Use natural language processing libraries such as NLTK or SpaCy to load pre-trained language models and perform part-of-speech tagging on each word in each consultation text. The results include part-of-speech information for each word, such as nouns, verbs, adjectives, etc. Combine these part-of-speech data with the original syntactic structure data and store them in a unified structured file. Use the syntactic structure data and part-of-speech tagging data to perform semantic enhancement on the consulting text. Introduce word vector models such as Word2Vec or GloVe to convert each word into a vector representation to capture its semantic information. Combined with the context, use the Attention mechanism or the Transformers architecture to further enhance the semantic representation. The generated semantic enhancement data includes the enhanced semantic vector representation of each consulting text and is stored in a structured file or database. Select the BERT-BiLSTM-CRF model for deep semantic fusion entity recognition. First, use the BERT model to encode the consulting text and generate a contextual semantic vector. Then, pass the output of BERT to the BiLSTM network to capture sequence information. Finally, use the CRF layer to perform entity recognition and mark the entities in the text. Model training requires a pre-annotated entity dataset, and optimize the model parameters through supervised learning. After training, the model performs entity recognition on the new consulting text and outputs consulting semantic fusion entity data including entity category and location, which is stored in a database or structured file.
[0099] Preferably, step S15 comprises the following steps:
[0100] Step S151: using the BERT component in the BERT-BiLSTM-CRF model to perform consultation question request attribute recognition on the user online consultation semantic enhancement data and the user online consultation part-of-speech data to obtain consultation question request attribute data;
[0101] Step S152: extracting the bidirectional relationship between the question request and the consulting question request attribute data to obtain the bidirectional relationship data between the question request and the consulting question request;
[0102] Step S153: Eliminate invalid sequence feature data of the consulting question request attribute data according to the question request bidirectional relationship data to obtain valid sequence feature data of the question request;
[0103] Step S154: Perform deep semantic fusion entity recognition based on the question-request bidirectional relationship data and the question-request sequence feature valid data to obtain consultation semantic fusion entity data.
[0104] In an embodiment of the present invention, first, the BERT component is used to process the user's online consultation semantic reinforcement data and part-of-speech data. The BERT model encodes the input text data through its pre-trained deep bidirectional Transformer architecture to generate a contextual semantic vector representation of each word. These semantic vectors are combined with the part-of-speech tagging data and input into the BERT-BiLSTM-CRF model to identify the request attributes in the consulting question. For example, for a question like "What is the water level of the Yangtze River Reservoir?", the BERT component will identify attributes such as "reservoir" and "water level". The output result is the request attribute data of each consulting text, which indicates each word and its corresponding attribute category and is stored in a structured file. After obtaining the consulting question request attribute data, bidirectional relationship extraction is performed. The attribute data is processed using a BiLSTM network to capture the front-and-backward relationship between words. The BiLSTM network can simultaneously consider the forward and backward context information and extract the dependency relationship between words. By training a supervised bidirectional relationship model, the association between different attributes in the consulting question is identified. For example, in the question "What is the water level of the Yangtze River Reservoir?", the relationship between "reservoir" and "water level" is identified. The extraction results generate question request bidirectional relationship data, which contains words and their associations, and is stored in the database. Using the bidirectional relationship data, invalid features are removed from the consulting question request attribute data. First, by analyzing the bidirectional relationship data, determine which features are not effective in semantic recognition. Use feature selection algorithms such as information gain or chi-square test to evaluate the importance of each feature. Eliminate invalid or redundant features and retain features that contribute significantly to question recognition and answering. For example, remove irrelevant stop words or words that appear frequently but have no practical meaning. The result generates question request sequence feature valid data, which contains screened valid features and is stored in a structured file. Finally, use the bidirectional relationship data and valid feature data for deep semantic fusion entity recognition. These data are input into the BERT-BiLSTM-CRF model again and fused through the deep learning algorithm. The BERT model provides semantic encoding, BiLSTM captures sequence relationships, and the CRF layer performs final entity recognition and labeling. The model combines request attributes and bidirectional relationship data to accurately identify key entities in the consulting text. For example, in the question "What is the water level of the Yangtze River Reservoir?", "Yangtze River Reservoir" and "water level" are finally identified as key entities. The generated consultation semantic fusion entity data, including the entities and their categories identified in each consultation text, is stored in the database to provide basic data support for the intelligent question answering system.
[0105] Preferably, removing invalid sequence features from the consulting question request attribute data according to the question request bidirectional relationship data comprises the following steps:
[0106] According to the bidirectional relationship data of the question request, attribute data of the consulting question request is injected into the bidirectional serialization of the attributes to obtain a bidirectional sequence of the question request attributes;
[0107] Perform dependency association identification on the bidirectional sequence of question request attributes to obtain bidirectional dependency association data of the question request;
[0108] The CRF layer in the BERT-BiLSTM-CRF model is used to iteratively collect training data for question-request bidirectional dependency association data to obtain question-request bidirectional dependency iterative training data;
[0109] The preset training error constraint model is used to eliminate invalid sequence features of question request bidirectional dependency iterative training data to obtain valid data of question request sequence features.
[0110] In an embodiment of the present invention, based on the attribute data of the consultation question request, the attribute bidirectional serialization injection is performed using the bidirectional relationship data. The specific operation is to combine each attribute data with its bidirectional relationship to form an ordered bidirectional sequence. For example, for the attributes "reservoir" and "water level" in "What is the water level of the Yangtze River Reservoir?", the bidirectional relationship is injected to form a bidirectional sequence "reservoir <-> water level". This step can be implemented by a custom serialization algorithm, and the resulting bidirectional sequence of question request attributes includes all attributes and their mutual relationships. Based on the attribute bidirectional sequence, dependency association identification is performed for each sequence. Dependency parsing tools such as SpaCy or Stanford Parser are used to analyze the dependency relationships of each attribute in the sequence. For example, in the sequence "reservoir <-> water level", the dependency relationship between "reservoir" and "water level" is identified, and the corresponding dependency relationship data is generated. This step outputs the bidirectional dependency association data of the question request, including detailed information on the attributes and their mutual dependencies, which is stored in a structured file. The bidirectional dependency association data of the question request is input into the BERT-BiLSTM-CRF model, and the CRF layer is used to collect iterative training data. The CRF layer can accurately identify the effective features in the sequence through multiple iterative optimizations. During each iteration, the model is trained based on the current dependency data and the training results are collected. Through multiple rounds of training, question request bidirectional dependency iterative training data is generated, including feature weights and optimization results after each iteration. Finally, the preset training error constraint model is used to remove invalid features from the collected bidirectional dependency iterative training data. The training error constraint model determines which features have high errors in training and need to be removed by evaluating the error contribution of each feature. The specific operation includes setting an error threshold, filtering out features whose errors exceed the threshold, and removing them from the data set. For example, if some dependency features have high errors in multiple trainings, they are marked as invalid features and removed. The result generates valid data of question request sequence features, including valid features after screening, which are stored in structured files or databases for subsequent deep semantic fusion entity recognition.
[0111] Preferably, step S2 comprises the following steps:
[0112] Step S21: classifying the consultation questions between different consultation entities on the user online water conservancy consultation dataset according to the consultation semantic fusion entity data and the user online consultation part-of-speech data, and obtaining the water conservancy consultation entity question classification data;
[0113] Step S22: Perform tone difference perception on the water conservancy consulting entity question classification data to obtain consulting question tone difference perception data;
[0114] Step S23: linking the water conservancy consulting entity question classification data with question target attributes according to the consulting question tone difference perception data to obtain question target attribute link data;
[0115] Step S24: constructing a question matching template for the user's online water conservancy consultation dataset according to the question target attribute link data to obtain a conventional target question matching template and a complex target question matching template.
[0116] As an example of the present invention, refer to Figure 2 As shown, in this example, step S2 includes:
[0117] Step S21: classifying the consultation questions between different consultation entities on the user online water conservancy consultation dataset according to the consultation semantic fusion entity data and the user online consultation part-of-speech data, and obtaining the water conservancy consultation entity question classification data;
[0118] In an embodiment of the present invention, first, the consultation questions are classified according to the consultation semantic fusion entity data and the user's online consultation part-of-speech data. A classification model is constructed using a machine learning classification algorithm, such as a support vector machine (SVM) or a random forest. The input features include semantic fusion entities and their corresponding part-of-speech information. After the model is trained, each question in the user's online water conservancy consultation data set is classified and the questions are divided into different entity categories, such as "reservoir", "river" or "water level". Finally, the water conservancy consultation entity question classification data is generated and stored in a structured file or database for subsequent processing.
[0119] In another embodiment, a naive Bayes classification algorithm is used to classify the question, obtain the question classification result and question entity, and obtain the question target attribute.
[0120] The naive Bayes classifier is based on Bayes' theorem, which is a formula that describes the conditional probability relationship of statistics. Bayes' theorem expresses the probability of an event occurring, and the method of determining this probability is based on the conditional prior knowledge related to the event. Conditional probability refers to the probability of event A occurring when event B occurs. It is usually recorded as . The Naive Bayes algorithm is based on the Bayesian theorem and assumes that the feature conditions are independent of each other. First, through the given training set, the independence of feature words is assumed as the premise to learn the joint probability distribution from input to output. Then, based on the learned model, input X and find the output Y that maximizes the posterior probability. The calculation formula of Naive Bayes is:
[0121]
[0122] because is fixed, the naive Bayes classifier only needs to find the largest molecule, and the classifier formula is as follows:
[0123] .
[0124] Step S22: Perform tone difference perception on the water conservancy consulting entity question classification data to obtain consulting question tone difference perception data;
[0125] In an embodiment of the present invention, after obtaining the classification data of water conservancy consulting entity questions, tone difference perception processing is performed. The tone of each question is analyzed by natural language processing technology, and sentiment analysis tools or sentiment dictionaries (such as SentiWordNet) are used to identify the emotional tendency and tone of the question. For example, the question "Can the water level of the reservoir be raised?" and "Why can't the water level of the reservoir be raised?" have significant differences in tone. Based on the analysis results, the tone difference perception data of the consulting question is generated, the emotional characteristics of the question and its corresponding tone type are recorded, and stored in the database.
[0126] Step S23: linking the water conservancy consulting entity question classification data with question target attributes according to the consulting question tone difference perception data to obtain question target attribute link data;
[0127] In an embodiment of the present invention, the target attribute linking of the water conservancy consulting entity question classification data is performed using the consultation question tone difference perception data. First, based on the tone and entity classification information, the target attribute of each question is defined, such as the value of the "water level", the feasibility of rising, etc. The graph reasoning technology is used in combination with the water conservancy knowledge graph to ensure the accuracy and rationality of the link. Finally, the question target attribute linking data is generated, and the target attributes of each question and their relationships are recorded and stored in a structured database to support subsequent template construction.
[0128] Step S24: constructing a question matching template for the user's online water conservancy consultation dataset according to the question target attribute link data to obtain a conventional target question matching template and a complex target question matching template.
[0129] In the embodiment of the present invention, finally, according to the question target attribute link data, a question matching template is constructed for the user's online water conservancy consultation data set. First, the standards for conventional target questions and complex target questions are defined. Conventional questions are usually direct questions, and complex questions involve multiple attributes or conditions. Using natural language generation technology, matching templates are generated for different target attributes. For example, the template for a conventional target question is "What is the water level of the reservoir?", and the template for a complex target question is "What measures should be taken if the water level exceeds the safety line?" After the template generation is completed, it is stored in the database for the intelligent question and answer system to call.
[0130] Preferably, step S23 includes the following steps:
[0131] Step S231: performing sentiment tendency analysis on the consultation question tone difference perception data to obtain consultation sentiment tendency data;
[0132] Step S232: performing water conservancy entity association analysis on the water conservancy consulting entity question classification data according to the consulting sentiment tendency data and the consulting question tone difference perception data to obtain water conservancy entity question tone association data;
[0133] Step S233: extracting water conservancy entity context dependency from the water conservancy entity question tone association data to obtain water conservancy entity context dependency data;
[0134] Step S234: performing non-monotonic logic processing according to the water conservancy entity context-dependent data to obtain context-dependent non-monotonic logic data;
[0135] Step S235: performing first-order logic quantization processing on the water conservancy entity context-dependent data according to the context-dependent non-monotonic logic data to obtain first-order logic quantization data of the water conservancy entity;
[0136] Step S236: linking the water conservancy consulting entity question classification data with question target attributes according to the context-dependent non-monotonic logic data and the water conservancy entity first-order logic quantification data to obtain question target attribute linking data.
[0137] In the embodiment of the present invention, in this step, the sentiment analysis tool is used to process the consultation question tone difference perception data. Natural language processing technology, such as VADER or TextBlob, is used to analyze the sentiment tendency of each question. By calculating the positive, negative and neutral sentiment scores in the question, the consultation sentiment tendency data is generated. For example, for a question such as "Can the water level of the reservoir be raised?", the sentiment analysis tool returns a positive tendency, reflecting the concern about the water level increase. The final output data structure includes the sentiment tendency and corresponding score of each question, which is stored in the database for subsequent use. Based on the consultation sentiment tendency data and the tone difference perception data, water conservancy entity association analysis is performed. Graph database technology (such as Neo4j) or relational database is used to analyze the relationship between entities in the question. By constructing a relationship network between entities, the connection between entities with similar sentiment tendencies is identified. For example, establish a sentiment association between "reservoir" and "water level", and mark their relationship under a specific tone. As a result, water conservancy entity question tone association data is generated, which includes the sentiment relationship between each water conservancy entity in the question and is stored in a structured database. After obtaining the tone-related data of the water conservancy entity question, context dependency extraction is performed. Context analysis tools, such as SpaCy's dependency parsing function, are used to extract the context dependency relationship of each entity in the question. For example, in "What is the water level of the Yangtze River Reservoir?", the dependency relationship between "Yangtze River Reservoir" and "water level" is extracted, reflecting their contextual position and function in the question. Finally, the water conservancy entity context dependency data is generated, the context information of each entity is recorded, and stored in a structured database. Non-monotonic logic processing is performed based on the water conservancy entity context dependency data. This step uses a non-monotonic reasoning mechanism to handle uncertainty and dynamic changes in the context. For example, by introducing rules and constraints, non-monotonic relationships between entities in the context are identified and their dependency states are adjusted. This analysis is completed using a logic programming language (such as Prolog) or a knowledge graph reasoning tool. Finally, context-dependent non-monotonic logic data is generated, the logical relationship of each entity in a specific context is recorded, and stored in a database. In this step, the context-dependent non-monotonic logic data is used for first-order logic quantification. The entities and their relationships in the context are formalized using first-order logic expressions. For example, by constructing a quantitative formula, "there is a reservoir such that the water level meets a certain condition" can be expressed as a first-order logic statement. This process can be implemented using logic programming tools or symbolic computing libraries. Finally, the first-order logic quantitative data of water conservancy entities is obtained, and each entity and its logical relationship is recorded and stored in a structured database. Finally, the target attribute link is performed on the classification data of water conservancy consulting entity questions using context-dependent non-monotonic logic data and first-order logic quantitative data of water conservancy entities. By setting rules and logical reasoning, the specific attributes pointed to by each question are identified.For example, by inferring the attributes related to the Yangtze River Reservoir, such as "water level" or "capacity", the link between the question and the attribute is realized. The final generated question target attribute link data is stored in the database using an inference engine (such as Apache Jena), forming a complete relationship between the question and the target attribute, providing a basis for the subsequent question matching template construction.
[0138] Preferably, step S24 includes the following steps:
[0139] Step S241: using the preset question format parsing recognition model and question target attribute link data to divide the user's online water conservancy consultation data set into parsing difficulty categories, and obtain conventional water conservancy consultation question parsing data and complex water conservancy consultation question parsing data;
[0140] Step S242: extracting water conservancy query elements from the conventional water conservancy consultation question parsing data to obtain water conservancy conventional query element data;
[0141] Step S243: using cypher query statements to match the water conservancy general query element data, to obtain a water conservancy general query statement;
[0142] Step S244: constructing a conventional problem matching template according to the conventional water conservancy query statement to obtain a conventional target problem matching template;
[0143] Step S245: construct a complex problem matching template for the complex water conservancy consultation question parsing data to obtain a complex target problem matching template.
[0144] In the embodiment of the present invention, in this step, a preset question format parsing recognition model is first used, which combines the question target attribute link data. Through this model, the user's online water conservancy consultation data set is divided into two categories: conventional and complex. For example, through model analysis and recognition, "What is the water resource situation in the Yangtze River Basin?" is classified as a complex question, while "What is the scale of the South-to-North Water Diversion Project?" is classified as a conventional question. The parsing result stores the conventional water conservancy consultation question parsing data and the complex water conservancy consultation question parsing data separately for subsequent processing. Next, based on the conventional water conservancy consultation question parsing data, the water conservancy query elements are extracted. This step relies on natural language processing technology and entity recognition tools, such as using SpaCy or StanfordNLP to identify key entities and attributes in the question. Taking "What is the scale of the South-to-North Water Diversion Project?" as an example, the key query elements "South-to-North Water Diversion" and "project scale" are extracted. These data will be used as input for subsequent processing to support the generation and matching of query statements. In this step, the Cypher query statements are used to match the previously extracted water conservancy general query element data. Cypher is the query language of the Neo4j graph database, which is used to perform complex query operations in the graph database. By matching the extracted query elements with the nodes and relationships in the water conservancy knowledge graph, a Cypher query statement that meets the query requirements is generated. For example, based on the node of "South-to-North Water Diversion" and the attribute of "project scale", a query statement is generated to retrieve relevant information. Finally, after obtaining the water conservancy general query statements, general question matching templates are constructed based on these statements. This process includes defining and arranging the template structure to ensure that each template can effectively match general water conservancy consulting questions. For example, templates are designed for multiple common query patterns, such as "information about XXX" or "what is the YYY situation of XXX". These templates will be stored as structured data for the question matching stage of the intelligent question answering system. Similarly, complex question matching templates are constructed for the parsed data of complex water conservancy consulting questions. This requires more complex logic and pattern matching technology to cope with questions with more complex question structures and more diverse information requirements. For example, "What is the water resource situation in the Yangtze River Basin?" involves multiple related entities and complex query paths. Building these templates involves more advanced semantic parsing and matching strategies to ensure that the system can effectively respond to query requirements for complex issues.
[0145] Preferably, constructing a complex problem matching template for complex water conservancy consultation question parsing data includes the following steps:
[0146] The two-dimensional matrix of complex water conservancy consultation question analysis data is constructed to obtain the two-dimensional matrix of complex water conservancy consultation question;
[0147] The structural similarity of the two-dimensional matrix of complex water conservancy consultation questions is calculated to obtain the structural similarity data of the two-dimensional matrix;
[0148] According to the two-dimensional matrix structure similarity data, convolution calculation is performed on the two-dimensional matrix of complex water conservancy consultation questions to obtain the question matrix structure similarity convolution data;
[0149] Perform question matrix feature pooling processing on the question matrix structural similarity convolution data to obtain question matrix feature pooling data;
[0150] Perform overfitting optimization processing based on the question matrix structural similarity convolution data and the question matrix feature pooling data to obtain the question matrix overfitting optimization data;
[0151] A complex question matching template is constructed based on the question matrix structural similarity convolution data, question matrix feature pooling data and matrix overfitting optimization data to obtain a complex target question matching template.
[0152] The present invention extracts key information from the parsed data of complex water conservancy consultation questions, such as entities, attributes, relationships, etc. involved in the question, and maps this information into a two-dimensional matrix. This process involves natural language processing technology and data structure design, such as using a data processing library in Python (such as NumPy) to construct and manage matrix data. For example, for the question "What is the water resource situation in the Yangtze River Basin?" "Yangtze River Basin" and "water resource situation" can be mapped to the rows and columns of the matrix respectively. The constructed two-dimensional matrix of the question is subjected to structural similarity calculation. This step uses mathematical or statistical methods, such as cosine similarity or other distance metrics, to evaluate the similarity between rows and columns of different matrices. For example, the similarity between the row vector of "Yangtze River Basin" and the column vector of "water resource situation" is compared to determine their structural similarity. Next, the convolutional structural similarity data is subjected to feature pooling. Feature pooling aims to reduce the dimension of the data while retaining the most important information features. This can be achieved by pooling operations (such as maximum pooling or average pooling) to extract the most significant structural features in the question matrix. In this step, the obtained convolution data and pooling data are used for overfitting optimization. The purpose of overfitting optimization is to make the data of the question matrix more consistent with the complexity and diversity of actual scenarios through model selection or parameter adjustment. For example, regularization techniques or model adjustment methods can be used to avoid over-reliance on specific samples or situations. Finally, the optimized question matrix data is combined with the structural similarity convolution data and feature pooling data to construct complex question matching templates. These templates can more accurately respond to the diversity and specific needs of complex questions. For example, according to different matrix structures and features, highly targeted question templates are designed, such as "What are the details about XXX in terms of YYY?". These templates will serve as a key component of the intelligent question-answering system to provide accurate responses to complex questions.
[0153] Preferably, step S3 comprises the following steps:
[0154] Step S31: using a preset water conservancy knowledge graph to perform water conservancy knowledge deep response processing on conventional target problem matching templates and complex target problem matching templates to obtain conventional problem water conservancy knowledge response data and complex problem water conservancy knowledge response data;
[0155] Step S32: extracting characteristic responses from the conventional water conservancy knowledge response data and the complex water conservancy knowledge response data respectively, to obtain the conventional water conservancy knowledge characteristic response data and the complex water conservancy knowledge characteristic response data.
[0156] The present invention uses a pre-built water conservancy knowledge graph as a knowledge base to perform deep response processing on conventional target question matching templates and complex target question matching templates. This process involves retrieving relevant water conservancy field knowledge from the knowledge graph and generating responses according to the requirements of the question template. For example, for a conventional question template "What are the design features of XXX reservoir?", the system will query the knowledge graph for specific information about the design features of XXX reservoir and generate corresponding water conservancy knowledge response data. Graph database technology such as Neo4j can be used to store and query water conservancy knowledge graphs, and relevant libraries in Python such as Py2Neo can be used to interact with Neo4j databases. By writing query statements and response generation logic, the system can effectively extract and structure relevant water conservancy field knowledge from the knowledge graph, and provide basic data for responses for subsequent intelligent question-answering systems. Feature response extraction is performed for conventional question water conservancy knowledge response data and complex question water conservancy knowledge response data obtained from the knowledge graph. The purpose of this step is to extract key feature information from the response data for subsequent question matching and response generation. For example, for the response data "The design features of XXX reservoir include flood control, water storage and irrigation functions", the key features that the system can extract include flood control, water storage and irrigation. In the implementation process, natural language processing (NLP) technologies such as part-of-speech tagging, named entity recognition (NER) and keyword extraction can be used in combination with relevant libraries in Python such as NLTK or spaCy to perform feature extraction operations. These tools and technologies can help the system automatically extract the required key information from text data and provide support for the response generation of the intelligent question-answering system.
[0157] Preferably, step S31 includes the following steps:
[0158] Step S311: using a preset water conservancy knowledge graph to perform graph node data similarity matching on a conventional target problem matching template and a complex target problem matching template, to obtain conventional problem node similarity matching data and complex problem node similarity matching data;
[0159] Step S312: performing association result similarity data iteration on the common problem node similarity matching data and the complex problem node similarity matching data respectively, to obtain common problem result similarity iteration data and complex problem result similarity iteration data;
[0160] Step S313: constructing triple tables for the similar iteration data of the conventional problem results and the similar iteration data of the complex problem results respectively, to obtain a similar iteration triple table of the conventional problem results and a similar iteration triple table of the complex problem results;
[0161] Step S314: performing semantic relationship dynamic query optimization according to the similar iterative triple table of conventional question results and the similar iterative triple table of complex question results, and obtaining conventional question result query optimization data and complex question result query optimization data;
[0162] Step S315: sorting the regular problem result query optimization data and the complex problem result query optimization data by result repetition ratio, respectively, to obtain regular result repetition ratio sorting data and complex result repetition ratio sorting data;
[0163] Step S316: Optimize and adjust the word order output according to the repetition ratio sorting data of the conventional results and the repetition ratio sorting data of the complex results to obtain the water conservancy knowledge response data of the conventional problems and the water conservancy knowledge response data of the complex problems.
[0164] In an embodiment of the present invention, a preset water conservancy knowledge graph is first used to perform graph node data similarity matching on a conventional target problem matching template and a complex target problem matching template. In a specific operation, a method such as cosine similarity or Jaccard similarity is used to calculate the similarity of graph nodes. The Scikit-learn library in Python can be used to calculate the similarity of node feature vectors. Through this calculation process, conventional problem node similar matching data and complex problem node similar matching data are generated to support subsequent processing steps. For the conventional problem node similar matching data and the complex problem node similar matching data, similar data of the association results are iteratively processed. Using the PageRank algorithm or the Iterative Nearest Neighbor method, the association results between similar nodes are repeatedly calculated and gradually converged to a stable value. This iterative process ensures the accuracy of the similarity results, and finally obtains the conventional problem result similar iterative data and the complex problem result similar iterative data. Using the conventional problem result similar iterative data and the complex problem result similar iterative data, a triple table is constructed. The format of the triple table is usually (subject, relationship, object), which is convenient for subsequent query and processing. Using the Pandas library in Python, these data can be efficiently organized and stored. Taking conventional questions as an example, the constructed triple table includes "reservoir (subject) - inclusion (relation) - water resources (object)". Finally, a similar iterative triple table of conventional question results and a similar iterative triple table of complex question results are generated. This step performs dynamic query optimization of semantic relationships based on the constructed triple table. By adjusting the query strategy, it can better adapt to the graph structure and user query characteristics. Using query languages such as GraphQL or SPARQL, query conditions and strategies are dynamically adjusted to optimize query performance. Finally, the query optimization data of conventional question results and the query optimization data of complex question results are obtained, providing an efficient query method for subsequent data return. In this step, the optimized query results are sorted by repetition ratio. By calculating the ratio of repeated data in the query results, the set is deduplicated and the number of repeated elements is counted. The most representative results in the query optimization data of conventional question results and the query optimization data of complex question results are identified by sorting, and finally the repetition ratio sorting data of conventional results and the repetition ratio sorting data of complex results are obtained. Finally, according to the repetition ratio ranking data of the conventional results and the repetition ratio ranking data of the complex results obtained above, the word order output is optimized and adjusted. By rearranging the order of the results, the most relevant and representative results are placed in front to improve the user experience. The results can be sorted according to the repetition ratio and the comprehensive score of relevance, and finally the water conservancy knowledge response data of the conventional questions and the water conservancy knowledge response data of the complex questions are output.
[0165] Therefore, the embodiments should be regarded as illustrative and non-restrictive from all points, and the scope of the present invention is limited by the appended claims rather than the above description, and it is therefore intended that all changes falling within the meaning and range of equivalent elements of the application documents are included in the present invention.
[0166] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those 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 should conform to the widest scope consistent with the principles and novel features invented herein.
Claims
1. A method for constructing an intelligent question-answering system based on a water conservancy knowledge graph, characterized in that: The following steps are involved: Step S1: Obtain user online water conservancy consultation dataset; Perform part-of-speech tagging on the user online water conservancy consultation dataset to obtain the user online consultation part-of-speech data; Perform deep semantic fusion entity recognition on the user's online consultation part-of-speech data to obtain consultation semantic fusion entity data; Step S2: Classify the consultation questions between different consultation entities on the user's online water conservancy consultation dataset according to the consultation semantic fusion entity data to obtain the water conservancy consultation entity question classification data; Perform question target attribute linking on the water conservancy consulting entity question classification data to obtain question target attribute linking data; According to the question target attribute link data, the user online water conservancy consultation dataset is used to construct a question matching template, and a conventional target question matching template and a complex target question matching template are obtained; wherein, the question matching template construction for the user online water conservancy consultation dataset includes: The preset question format parsing recognition model and question target attribute link data are used to divide the parsing difficulty of the user online water conservancy consultation dataset, and the parsing data of conventional water conservancy consultation questions and complex water conservancy consultation questions are obtained; Extract water conservancy query elements from the parsed data of conventional water conservancy consultation questions to obtain water conservancy conventional query element data; use cypher query statements to match the water conservancy conventional query element data to obtain water conservancy conventional query statements; According to the conventional water conservancy query statements, a conventional problem matching template is constructed to obtain a conventional target problem matching template; A complex problem matching template is constructed for the complex water conservancy consulting question parsing data to obtain a complex target problem matching template; wherein, the complex problem matching template is constructed for the complex water conservancy consulting question parsing data includes: The two-dimensional matrix of complex water conservancy consultation question analysis data is constructed to obtain the two-dimensional matrix of complex water conservancy consultation question; The structural similarity of the two-dimensional matrix of complex water conservancy consultation questions is calculated to obtain the structural similarity data of the two-dimensional matrix; According to the two-dimensional matrix structure similarity data, convolution calculation is performed on the two-dimensional matrix of complex water conservancy consultation questions to obtain the question matrix structure similarity convolution data; Perform question matrix feature pooling processing on the question matrix structural similarity convolution data to obtain question matrix feature pooling data; Perform overfitting optimization processing based on the question matrix structural similarity convolution data and the question matrix feature pooling data to obtain the question matrix overfitting optimization data; A complex question matching template is constructed based on the question matrix structural similarity convolution data, question matrix feature pooling data, and matrix overfitting optimization data to obtain a complex target question matching template; Step S3: performing water conservancy knowledge deep response processing on the conventional target problem matching template and the complex target problem matching template to obtain conventional problem water conservancy knowledge feature response data and complex problem water conservancy knowledge feature response data; Step S4: Design a question-and-answer response mechanism based on the water conservancy knowledge feature response data for routine questions and the water conservancy knowledge feature response data for complex questions to obtain a water conservancy knowledge question-and-answer response mechanism; construct an intelligent question-and-answer system based on the water conservancy knowledge question-and-answer response mechanism to obtain a water conservancy knowledge intelligent question-and-answer system.
2. The method for constructing an intelligent question-answering system based on a water conservancy knowledge graph according to claim 1 is characterized in that: Step S1 includes the following steps: Step S11: obtaining a user's online water conservancy consultation data set; Step S12: Performing syntactic structure analysis on the user online water conservancy consultation data set to obtain the user online consultation syntactic structure data; Step S13: performing part-of-speech tagging on the user online water conservancy consultation dataset according to the user online consultation syntactic structure data to obtain the user online consultation part-of-speech data; Step S14: semantically enhancing the user online water conservancy consultation dataset according to the user online consultation syntactic structure data and the user online consultation part-of-speech data to obtain the user online consultation semantic enhancement data; Step S15: Use the BERT-BiLSTM-CRF model to perform deep semantic fusion entity recognition on the user online consultation semantic enhancement data and the user online consultation part-of-speech data to obtain consultation semantic fusion entity data.
3. The method for constructing an intelligent question-answering system based on a water conservancy knowledge graph according to claim 2 is characterized in that: Step S15 includes the following steps: Step S151: using the BERT component in the BERT-BiLSTM-CRF model to perform consultation question request attribute recognition on the user online consultation semantic enhancement data and the user online consultation part-of-speech data to obtain consultation question request attribute data; Step S152: extracting the bidirectional relationship between the question request and the consulting question request attribute data to obtain the bidirectional relationship data between the question request and the consulting question request; Step S153: Eliminate invalid sequence feature data of the consulting question request attribute data according to the question request bidirectional relationship data to obtain valid sequence feature data of the question request; Step S154: Perform deep semantic fusion entity recognition based on the question-request bidirectional relationship data and the question-request sequence feature valid data to obtain consultation semantic fusion entity data.
4. The method for constructing an intelligent question-answering system based on a water conservancy knowledge graph according to claim 3 is characterized in that: Eliminating invalid sequence features of the consulting question request attribute data according to the question request bidirectional relationship data includes the following steps: According to the bidirectional relationship data of the question request, attribute data of the consulting question request is injected into the bidirectional serialization of the attributes to obtain a bidirectional sequence of the question request attributes; Perform dependency association identification on the bidirectional sequence of question request attributes to obtain bidirectional dependency association data of the question request; The CRF layer in the BERT-BiLSTM-CRF model is used to iteratively collect training data for question-request bidirectional dependency association data to obtain question-request bidirectional dependency iterative training data; The preset training error constraint model is used to eliminate invalid sequence features of question request bidirectional dependency iterative training data to obtain valid data of question request sequence features.
5. The method for constructing an intelligent question-answering system based on a water conservancy knowledge graph according to claim 1 is characterized in that: Step S2 includes the following steps: Step S21: classifying the consultation questions between different consultation entities on the user online water conservancy consultation dataset according to the consultation semantic fusion entity data and the user online consultation part-of-speech data, and obtaining the water conservancy consultation entity question classification data; Step S22: Perform tone difference perception on the water conservancy consulting entity question classification data to obtain consulting question tone difference perception data; Step S23: linking the water conservancy consulting entity question classification data with question target attributes according to the consulting question tone difference perception data to obtain question target attribute link data; Step S24: constructing a question matching template for the user's online water conservancy consultation dataset according to the question target attribute link data to obtain a conventional target question matching template and a complex target question matching template.
6. The method for constructing an intelligent question-answering system based on a water conservancy knowledge graph according to claim 5 is characterized in that: Step S23 includes the following steps: Step S231: performing sentiment tendency analysis on the consultation question tone difference perception data to obtain consultation sentiment tendency data; Step S232: performing water conservancy entity association analysis on the water conservancy consulting entity question classification data according to the consulting sentiment tendency data and the consulting question tone difference perception data to obtain water conservancy entity question tone association data; Step S233: extracting water conservancy entity context dependency from the water conservancy entity question tone association data to obtain water conservancy entity context dependency data; Step S234: performing non-monotonic logic processing according to the water conservancy entity context-dependent data to obtain context-dependent non-monotonic logic data; Step S235: performing first-order logic quantization processing on the water conservancy entity context-dependent data according to the context-dependent non-monotonic logic data to obtain first-order logic quantization data of the water conservancy entity; Step S236: linking the water conservancy consulting entity question classification data with question target attributes according to the context-dependent non-monotonic logic data and the water conservancy entity first-order logic quantification data to obtain question target attribute linking data.
7. The method for constructing an intelligent question-answering system based on a water conservancy knowledge graph according to claim 1 is characterized in that: Step S3 includes the following steps: Step S31: using a preset water conservancy knowledge graph to perform water conservancy knowledge deep response processing on conventional target problem matching templates and complex target problem matching templates to obtain conventional problem water conservancy knowledge response data and complex problem water conservancy knowledge response data; Step S32: extracting characteristic responses from the conventional water conservancy knowledge response data and the complex water conservancy knowledge response data respectively, to obtain the conventional water conservancy knowledge characteristic response data and the complex water conservancy knowledge characteristic response data.
8. The method for constructing an intelligent question-answering system based on a water conservancy knowledge graph according to claim 7 is characterized in that: Step S31 includes the following steps: Step S311: using a preset water conservancy knowledge graph to perform graph node data similarity matching on a conventional target problem matching template and a complex target problem matching template, to obtain conventional problem node similarity matching data and complex problem node similarity matching data; Step S312: performing association result similarity data iteration on the common problem node similarity matching data and the complex problem node similarity matching data respectively, to obtain common problem result similarity iteration data and complex problem result similarity iteration data; Step S313: constructing triple tables for the similar iteration data of the conventional problem results and the similar iteration data of the complex problem results respectively, to obtain a similar iteration triple table of the conventional problem results and a similar iteration triple table of the complex problem results; Step S314: performing semantic relationship dynamic query optimization according to the similar iterative triple table of conventional question results and the similar iterative triple table of complex question results, and obtaining conventional question result query optimization data and complex question result query optimization data; Step S315: sorting the regular problem result query optimization data and the complex problem result query optimization data by result repetition ratio, respectively, to obtain regular result repetition ratio sorting data and complex result repetition ratio sorting data; Step S316: Optimize and adjust the word order output according to the repetition ratio sorting data of the conventional results and the repetition ratio sorting data of the complex results to obtain the water conservancy knowledge response data of the conventional problems and the water conservancy knowledge response data of the complex problems.
