Water conservancy knowledge semantic question and answer method and device, electronic equipment and storage medium

Through standardized processing and classification of water conservancy knowledge documents, combined with large language models and manual review, semantic similarity search was established, and the problems of inconsistent water conservancy knowledge processing and low recall rate in the existing system were solved, and more accurate and professional water conservancy was achieved. Knowledge Q&A.

CN119166755AInactive Publication Date: 2024-12-20HANGZHOU DINGCHUAN INFORMATION TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411657780.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2024-12-20
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing semantic question and answer system for water conservancy knowledge cannot effectively distinguish different types of water conservancy knowledge, resulting in different knowledge processing rules, low recall rate, inaccurate answers, lack of intuitive manual verification methods, low professionalism and credibility, and inability to Understanding professional terms, poor knowledge availability and inability to provide effective auxiliary decision-making.

Method used

By standardizing pre-processing and classification of water conservancy knowledge documents, formulating different types of disassembly processing rules and collection templates, extracting water conservancy knowledge elements and vectorizing them, summarizing and refining them with the help of large language models, conducting manual review, establishing corresponding mapping relationships, and using The semantic similarity algorithm retrieves user questions and generates the final answer based on the search results.

Benefits of technology

It improves the effectiveness and professionalism of water conservancy knowledge, improves the accuracy and recall of questions and answers, forms more effective water conservancy knowledge, enhances the availability of knowledge and assists in decision-making capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166755A_ABST
    Figure CN119166755A_ABST
Patent Text Reader

Abstract

The invention discloses a water conservancy knowledge semantic question and answer method and device, electronic equipment and a storage medium, and the method comprises the steps: carrying out the standardized preprocessing of various water conservancy knowledge documents, and carrying out the classification according to business rules, historical scenes, forecast scheduling schemes, expert experience and water conservancy project safety; according to different water conservancy knowledge types, formulating corresponding water conservancy knowledge disassembly processing rules and collection templates, and according to the disassembly processing rules and the collection templates, extracting water conservancy knowledge element information; summarizing and extracting the original water conservancy knowledge in a cue word form by means of a large language model to form an abstract summary of the original water conservancy knowledge; auditing and correcting the original water conservancy knowledge and the abstract summary of the original water conservancy knowledge in a manual mode; vectorizing the user question, and performing semantic similarity retrieval to obtain a retrieval result; and based on the retrieval result, summarizing through a large language model to form a final answer and returning the final answer to the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of intelligent question-answering of water conservancy knowledge, and in particular to a method and device for semantic question-answering of water conservancy knowledge, an electronic device, and a storage medium. Background Art

[0002] In recent years, the top-level designs of digital twin river basins, digital twin water networks, and digital twin engineering construction technical guidelines have been successively introduced, proposing the construction of a water conservancy knowledge platform to collect relevant data generated by the data base and the analysis and calculation results of the model platform, and to construct a water conservancy business rule base, historical scenarios, forecast and scheduling plans, expert experience, water conservancy project safety and other water conservancy-related knowledge bases, providing information describing principles, laws, rules, experience, skills, methods, etc., to support information for research and judgment and decision-making.

[0003] With the emergence of large language models represented by ChatGPT, with the help of open source large language models, through the langchain framework, based on water conservancy knowledge document data, it is easy to complete the construction of local water conservancy knowledge base, and realize basic human-computer interactive semantic question and answer in a natural language interactive way. The basic idea is to disassemble the document content according to text blocks to form vectorized knowledge, and compare the vectorized user questions with the vectorized knowledge after disassembly according to the similarity algorithm to find the most similar knowledge. However, this disassembly processing method that does not distinguish different types of water conservancy knowledge makes the knowledge processing rules different and cannot form effective water conservancy knowledge. At present, there is still a common problem of low recall rate, which leads to deviations in the output summary of large models. There is a lack of intuitive manual verification methods, the professionalism and credibility of water conservancy knowledge are not high, the professional terms of water conservancy cannot be understood, the answers are inaccurate, the knowledge availability is poor, and effective auxiliary decision-making cannot be provided. Summary of the invention

[0004] In order to solve the above technical problems, the embodiments of the present application provide a water conservancy knowledge semantic question answering method and device, and an electronic device.

[0005] According to a first aspect of an embodiment of the present application, a water conservancy knowledge semantic question answering method is provided, comprising: Standardize and pre-process various water conservancy knowledge documents and classify them according to business rules, historical scenarios, forecast and dispatch plans, expert experience, and water conservancy project safety; According to different types of water conservancy knowledge, disassembly processing rules and collection templates are formulated to segment and disassemble water conservancy knowledge documents, extract water conservancy knowledge elements, form original water conservancy knowledge, and vectorize them to form original vectorized water conservancy knowledge; Summarize and refine the original water conservancy knowledge with the help of a large language model to form a summary overview of the original water conservancy knowledge, and vectorize it to form a summary overview of the original vectorized water conservancy knowledge, and then establish a corresponding mapping relationship with the original water conservancy knowledge and the original vectorized water conservancy knowledge; By manual review, the original water conservancy knowledge and the summary of the original water conservancy knowledge are checked to form the checked water conservancy knowledge and the summary of the checked water conservancy knowledge, and they are vectorized to form the checked vectorized water conservancy knowledge and the summary of the checked vectorized water conservancy knowledge, and the mapping relationship is updated; Through the semantic similarity algorithm, the summary of the verified vectorized water conservancy knowledge that is most similar to the user's question is retrieved, and the corresponding verified water conservancy knowledge is found according to the updated mapping relationship, and the search results are returned; Based on the retrieval results, a large language model is used to summarize and form a final answer, which is then returned.

[0006] According to a second aspect of an embodiment of the present application, a water conservancy knowledge semantic question-answering device is provided, comprising: The preprocessing classification module is used to perform standardized preprocessing on various water conservancy knowledge documents and classify them according to business rules, historical scenarios, forecast scheduling plans, expert experience, and water conservancy project safety; The disassembly processing module is used to formulate disassembly processing rules and collection templates according to different types of water conservancy knowledge, segment and disassemble water conservancy knowledge documents, extract water conservancy knowledge elements, form original water conservancy knowledge, and vectorize to form original vectorized water conservancy knowledge; A summarizing and refining module is used to summarize and refine the original water conservancy knowledge with the help of a large language model to form a summary overview of the original water conservancy knowledge, and to vectorize it to form a summary overview of the original vectorized water conservancy knowledge, and then establish a corresponding mapping relationship with the original water conservancy knowledge and the original vectorized water conservancy knowledge; An audit module is used to verify the original water conservancy knowledge and the summary of the original water conservancy knowledge through manual audit, form the verified water conservancy knowledge and the summary of the verified water conservancy knowledge, and vectorize them to form the verified vectorized water conservancy knowledge and the summary of the verified vectorized water conservancy knowledge, and update the mapping relationship; The retrieval module is used to retrieve the summary of the verified vectorized water conservancy knowledge that is most similar to the user's question through a semantic similarity algorithm, find the corresponding verified water conservancy knowledge according to the updated mapping relationship, and return the retrieval result; The summary output module is used to summarize the retrieval results through a large language model to form a final answer and return it.

[0007] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in the first aspect.

[0008] According to a third aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.

[0009] The technical solution provided by the embodiments of the present application may have the following beneficial effects: It can be seen from the above embodiments that the present application disassembles different types of water conservancy knowledge according to different disassembly rules and collection templates to extract key core information, thereby forming more effective water conservancy knowledge. Through a large language model, the disassembled knowledge is automatically summarized and refined to form a summary of water conservancy knowledge, thereby improving processing efficiency; through manual verification, the effectiveness and professionalism of water conservancy knowledge are improved, and erroneous and redundant knowledge is avoided. Semantic similarity retrieval based on the summary of water conservancy knowledge after manual verification improves the efficiency and effectiveness of retrieval, greatly improves the recall rate, and thus improves the accuracy of question and answering, compared to directly searching the original water conservancy knowledge itself.

[0010] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0012] Figure 1 It is a flow chart of a semantic question-answering method of water conservancy knowledge according to an exemplary embodiment.

[0013] Figure 2 It is a block diagram of a semantic question-answering device for water conservancy knowledge according to an exemplary embodiment.

[0014] Figure 3 The diagram is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0015] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.

[0016] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more associated listed items.

[0017] Figure 1 is a flow chart of a method for semantic question answering of water conservancy knowledge according to an exemplary embodiment. Figure 1 As shown, the method may include the following steps: S1: Standardize and pre-process various water conservancy knowledge documents and classify them according to business rules, historical scenarios, forecast and dispatch plans, expert experience, and water conservancy project safety; Specifically, various types of water conservancy knowledge documents are subjected to standardized preprocessing, including: removing irrelevant symbols and digital information in file names, standardizing naming according to the content of water conservancy knowledge documents, and removing watermarks, headers, footers, comments, and revision content in water conservancy knowledge documents.

[0018] Use string replacement to delete special symbols in the file name, including $, #, %, &, @, !, =. With the help of WPS JS macro development, WPS API or the document operation capabilities provided by Apache POI library, batch file editing operations can be easily implemented through program coding. For example, you can use the Apache POI library in Java language, get the header XWPFHeader and footer XWPFFooter object information through XWPFDocument, and then use the clearHeaderFooter method to clear the header and footer content, and at the same time clear the document watermark content; get the paragraph XWPFParagraph object through XWPFDocument, and then get the XWPFRun and CTR objects in turn, and then call removeCommentReference to delete the comment content. You can use WPS JS macro development to delete all comments through Application.ActiveDocument.DeleteAllComments(), and accept all revisions through Application.ActiveDocument.AcceptAllRevisions().

[0019] The collected water conservancy knowledge documents are processed in a regular manner to improve the quality of water conservancy knowledge documents, reduce the interference of the large model in the understanding of the document content during the subsequent disassembly process, and ensure the validity and integrity of water conservancy knowledge. Because by default, watermarks, headers, footers, comments, and revisions will also be mistaken for valid content, thus affecting the quality of water conservancy knowledge. Standardized document naming can not only help the large language model to effectively identify the content of water conservancy knowledge documents, but also provide a friendly user experience for the document source output of question and answer results.

[0020] Classify the water conservancy knowledge documents after standardized preprocessing according to business rules, historical scenarios, forecast and dispatch plans, expert experience, and water conservancy project safety; The business rules include water conservancy-related laws and regulations, rules and regulations, technical standards, management methods, and operating procedures; The historical scenarios include information on the execution of dispatch plans under specific historical conditions, rainstorms, plum rains, floods, typhoons, droughts, and flash flood disaster events; The forecast dispatching scheme includes reservoir forecast dispatching scheme, flood forecasting scheme, control and operation plan, and water resources dispatching scheme; The expert experience includes information on expert lists, and content in the form of text, formulas, graphics, and images formed through expert research and judgment during historical floods, droughts, flood prevention, and emergency rescue; The water conservancy project safety includes engineering risk hazards, hidden danger accident cases, engineering safety consultations, engineering safety appraisals, special safety inspections, emergency plans, engineering safety-related standards and specifications, and technical documents.

[0021] Classify water conservancy knowledge and clarify the content of each type of water conservancy knowledge, so as to facilitate the effective management of water conservancy knowledge and select the corresponding water conservancy knowledge disassembly and processing rules or collection templates when disassembling and processing. For example, water conservancy knowledge such as the summary of rainfall during the plum rain season and the investigation report on heavy rainstorm disasters should be classified as historical scenes, and the guidelines for the preparation of joint dispatching plans for river basin flood control projects (SL / T 818-2023) and the management regulations for large and medium-sized reservoirs (DB33 / T 2103-2018) should be classified as business rules.

[0022] S2: According to different types of water conservancy knowledge, formulate disassembly processing rules and collection templates, segment and disassemble water conservancy knowledge documents, extract water conservancy knowledge elements, form original water conservancy knowledge, and vectorize to form original vectorized water conservancy knowledge; Specifically, the water conservancy knowledge disassembly and processing rules and collection template are as follows: Business rule water conservancy knowledge disassembly and processing rules: Disassemble and process according to clauses or chapter numbers. For laws, regulations, management methods, and system regulations, identify the "Nth Article" in the document content and split it. The content between "Nth Article" and "N+1th Article" is the "Nth Article" content. Each clause is disassembled into a water conservancy knowledge. For standard specifications, disassemble and split according to the smallest first-level chapter number in the text. Business rule water conservancy knowledge has a specific format. Each clause or the smallest first-level chapter content is an independent knowledge point. The document content is disassembled into an independent water conservancy knowledge according to the clause or chapter number to ensure the integrity and logic of the water conservancy knowledge.

[0023] Historical scenario water conservancy knowledge collection template: contains information on the time, location, cause, impact, and disposal measures of historical events. Collect various types of information under historical scenarios to understand the historical situation at the time, review and summarize historical scenarios, and form historical experience. For example, there are typhoons in Zhejiang coastal areas every year. For typhoons with a greater impact, it is necessary to analyze their rainfall process and impact range, provide reference for subsequent analysis of similar typhoons, and form flood control and typhoon prevention experience.

[0024] Template for collecting water conservancy knowledge for forecast and dispatching scheme: includes basic information of water conservancy projects, dispatching objectives, dispatching principles, dispatching authority and other contents; basic information of water conservancy projects includes project name, project type, project scale, restricted water level during typhoon season, restricted water level during plum rain season, high water level for flood control, design flood level, verification water level, design flood standard, verification flood standard, dam height, dam crest length, dam crest width, reservoir capacity corresponding to design flood level, reservoir capacity corresponding to verification water level, dead water level for power generation, reservoir capacity corresponding to dead water level for power generation, protected population, total reservoir capacity and irrigation area; dispatching principles are broken down into execution conditions and corresponding execution actions for three different dispatching periods, namely flood dispatching principle during flood season, flood dispatching principle during non-flood season and benefit dispatching principle, forming knowledge in the format of what conditions trigger what actions.

[0025] Expert experience water conservancy knowledge collection template: contains the basic information of the expert list, educational background, work experience, honorary awards, scientific research results information, and the experience text, formula, graphic image information provided by the experts; the basic information of the expert list includes the expert's name, gender, date of birth, nationality, birthplace, native place, time of joining the work, political status, research direction, professional expertise, title, contact number, work unit, and current position; educational background includes graduation school, major, degree, and graduation time; scientific research results include published papers, obtained patents, and book information; work experience includes start time, end time, unit, position, and work content information; honorary awards include honorary name, time of obtaining, and information on the granting unit. Collect the information of the expert list and grasp the basic situation of the experts, so as to quickly find the expert information in the professional field in case of emergencies. For the personal valuable experience formed by water conservancy experts in the actual work process, based on the historical floods, droughts, flood control, and rescue processes, the experience content in the form of text, formulas, graphics, and images formed by experts can effectively help staff solve problems quickly and effectively. The valuable personal experience of experts has been summarized and refined, and can be directly stored as original water conservancy knowledge.

[0026] Water conservancy project safety and water conservancy knowledge collection template: Contains information on the time, location, cause, accident analysis, and preventive measures related to hidden danger accident cases. For engineering safety standards and specifications, refer to the business rules and water conservancy knowledge disassembly and processing rules for disassembly and processing. There are various safety hazards in the construction and operation of water conservancy projects. Water conservancy project facilities and equipment have relevant technical requirements during operation. Improper operation may cause safety problems. Collect water conservancy safety incident cases and safety specification requirements to provide a reference for the safe implementation of water conservancy projects and conduct warning education through water conservancy safety incidents.

[0027] The disassembly processing rules are divided into a general type disassembly processing method and a custom type disassembly processing method.

[0028] Water conservancy knowledge documents that are not subject to the water conservancy knowledge disassembly and processing rules and collection templates of the above-mentioned business rules shall be disassembled and processed in accordance with the general disassembly and processing methods.

[0029] The general disassembly processing method is to segment and disassemble the document content according to semantic understanding, specifically: Read the content of water conservancy knowledge documents, use natural language processing technology, and adopt semantic segmentation models, such as the text segmentation model based on sequence modeling (nlp_bert_document-segmentation_chinese-base) or the recursive segmentation model of Chinese text symbols (ChineseRecursiveTextSplitter), to segment and disassemble the water conservancy knowledge documents to form original water conservancy knowledge, and then perform vectorization processing to form original vectorized water conservancy knowledge, which is stored in the vector database.

[0030] The custom class disassembly method is to define the water conservancy knowledge disassembly processing method and the water conservancy knowledge elements to be collected according to the water conservancy knowledge disassembly processing rules and collection template, and extract the corresponding water conservancy knowledge element information through program coding and large language model. Specifically: Business rules for format specifications: Rules for disassembling and processing water conservancy knowledge documents: For laws, regulations, management methods, and systems and regulations, use the Python program open method to open the file, and then use the read method to read the content in the document. Use line breaks as paragraph markers, and use regular expressions to identify "Article N" (N is a Chinese number, such as one or two) for splitting. Find the starting position of the paragraph as "Article N", record the beginning of a clause, and continue until the end of the next "Article N+1". Extract the content in between as the "Article N" content, and disassemble each clause into a water conservancy knowledge item; for standard specifications, disassemble and split according to the smallest level chapter number in the text (such as 1.2.3), identify the paragraph that starts with a digital chapter format, and use regular expressions to determine whether it is in the "^\d+(\.\d+)+$" format to mark the beginning of a clause, and continue until the next paragraph that starts with a digital chapter format, and extract the content in between as a water conservancy knowledge item.

[0031] For water conservancy knowledge documents that do not have a fixed format range, a template prompt information in JSON format is formed according to the water conservancy knowledge collection template. The prompt words are set through the large language model. The prompt word format is such as: "Please serve as an expert in information extraction and extract the content in the text to fill in the template. Template: XXX, text: XXX" (the template is a JSON format template, and the text is the document content to be extracted). According to the template prompt information in JSON format, effective knowledge content is extracted from the water conservancy knowledge document. Each extracted content is regarded as a water conservancy knowledge element, and is vectorized and stored in the vector database.

[0032] The format of the expert basic information JSON template is as follows: { name: "", / / name gender: "", / / gender birthdate: "", / / Date of birth nation: "", / / nationality birthPlace: "", / / birthplace nativePlace: "", / / Place of origin workTime: "", / / Time to work politicalStatus: "", / / Political status major: "", / / Major researchDirection: "", / / research direction specialty: "", / / professional expertise professionalTitle: "", / / professional title telephone: "", / / Contact phone number workUnit: "", / / work unit currentDuties: "", / / Current duties educationalBackground: [ { institution: "", / / Graduate institution program: "", / / major degree: "", / / degree graduationDate: "" / / Graduation date }], / / Educational background workExperience: [{ startDate: "", / / start time endDate: "", / / end time workPlace: "", / / Workplace duties: "", / / duties workContent: "" / / work content } ], / / Work experience researchAchievements: paper: [ ], / / paper patent: [ ], / / Patent publications: [ ] / / publications }, / / Research results honorAndAwards: [{ honorName: "", / / Honor Name obtainTime: "", / / obtain time grantingUnit: "" / / Granting unit }] / / Honor Rewards } The vector database here can be a PostgreSQL database. After installing pgvector as a PostgreSQL plug-in, PostgreSQL can provide vector storage and query functions.

[0033] This application disassembles different types of water conservancy knowledge according to different disassembly rules and collection templates to extract key core information, thereby forming more effective water conservancy knowledge.

[0034] Specifically, a knowledge disassembly and processing module is developed to provide a water conservancy knowledge document uploading function. Water conservancy knowledge documents are uploaded according to categories. After reading the document content through the Python built-in function open method, the corresponding disassembly and processing method is selected according to the document category. According to the water conservancy knowledge disassembly and processing rules and collection templates, program coding is used to process the logic according to the disassembly rules or use a large language model to set prompt words, extract water conservancy knowledge elements, and form original water conservancy knowledge in text form. The original water conservancy knowledge is vectorized through a vectorization model (bge-large-zh-v1.5) to form original vectorized water conservancy knowledge, which is stored in a vector database.

[0035] S3: Summarize and refine the original water conservancy knowledge with the help of a large language model to form a summary of the original water conservancy knowledge, and vectorize it to form a summary of the original vectorized water conservancy knowledge, and then establish a corresponding mapping relationship with the original water conservancy knowledge and the original vectorized water conservancy knowledge; Specifically, a summary summary module is developed, a large language model is used, and prompt words are set. The prompt word format is such as: "Give the following text content fragment a title. The title should reflect the identification of the text content as much as possible, for example, the content comes from the article (if it is not mentioned, it is not necessary to reflect the article). The content is as follows: XXX" (XXX is the original water conservancy knowledge after disassembly). In the form of a scheduled task, the unprocessed original water conservancy knowledge is summarized one by one to form the corresponding original water conservancy knowledge summary overview, and marked as processed. The generated original water conservancy knowledge summary overview is vectorized to form the original vectorized water conservancy knowledge summary overview, which is stored in the vector database and forms a corresponding mapping relationship with the original water conservancy knowledge, the original water conservancy knowledge summary overview, and the original vectorized water conservancy knowledge. The large language model can be the online Tongyi Qianwen and Wenxin Yiyan, which generate the summary of water conservancy knowledge through interface calls; it can also be the open source ChatGLM3 and ChatGLM4, which publish the service interface after private deployment to complete the summary of the original water conservancy knowledge summary overview. Through the large language model, the disassembled knowledge is automatically summarized and refined to improve work efficiency. The purpose of summarizing water conservancy knowledge is to further summarize water conservancy knowledge, improve the focus of water conservancy knowledge content, and pave the way for subsequent semantic similarity retrieval.

[0036] S4: by manual review, the original water conservancy knowledge and the summary of the original water conservancy knowledge are checked to form the checked water conservancy knowledge and the summary of the checked water conservancy knowledge, and they are vectorized to form the checked vectorized water conservancy knowledge and the summary of the checked vectorized water conservancy knowledge, and the mapping relationship is updated; Specifically, a manual knowledge verification module is developed to provide a search and display function for querying the list of water conservancy knowledge documents. According to the water conservancy knowledge documents, the original water conservancy knowledge and the corresponding original water conservancy knowledge summary overview after disassembly processing in the vector database are queried and displayed through a text editing box; the manual verification function manually edits and modifies the original water conservancy knowledge and the original water conservancy knowledge summary overview. Through manual review and proofreading, the problematic original water conservancy knowledge and the corresponding original water conservancy knowledge summary overview content are corrected to form the verification water conservancy knowledge and the corresponding verification water conservancy knowledge summary overview; the deletion function deletes the irrelevant and redundant original water conservancy knowledge and the corresponding original water conservancy knowledge summary overview information; the saving function vectorizes the modified verification water conservancy knowledge and the corresponding verification water conservancy knowledge summary overview respectively to form the verification vectorized water conservancy knowledge and the verification vectorized water conservancy knowledge summary overview, which are saved together with the verification water conservancy knowledge and the corresponding verification water conservancy knowledge summary overview to the vector database to update the mapping relationship. Through manual verification, the effectiveness and professionalism of water conservancy knowledge are improved, erroneous and redundant knowledge is avoided, and professional and authoritative water conservancy knowledge is formed.

[0037] S5: Retrieve the summary of the verified vectorized water conservancy knowledge that is most similar to the user's question through the semantic similarity algorithm, find the corresponding verified water conservancy knowledge according to the updated mapping relationship, and return the search results; Specifically, a dialogue question-answering interaction module is developed to receive user input, send the user input question as a request to the search service, vectorize the user text input question, use the semantic similarity algorithm, match and search with the check vectorized water conservancy knowledge summary overview, find the most similar check vectorized water conservancy knowledge summary overview, find the corresponding check water conservancy knowledge according to the updated mapping relationship, and return the search result; if no content can be retrieved, match and search according to the check vectorized water conservancy knowledge, find the most similar check vectorized water conservancy knowledge, find the corresponding check water conservancy knowledge according to the updated mapping relationship; if still no content can be retrieved, return the result that has not been retrieved, and the result that has not been retrieved can be "based on the known information, the question cannot be answered". The semantic similarity algorithm can be selected as the length of the new vector obtained by subtracting two vectors (L2_distance), the negative value of the inner product of two vectors (vector_negative_inner_product), and the cosine value of the angle between two vectors (cosine_distance).

[0038] Since the summary information of water conservancy knowledge after manual verification is relatively accurate and concise, and is relatively consistent with the conventional user questioning method, searching the verified summary information of water conservancy knowledge can improve the pertinence and efficiency of the retrieval process and increase the recall rate.

[0039] S6: Based on the retrieval results, a large language model is used to summarize and form a final answer, which is returned to the user.

[0040] Specifically, the search results are sorted from high to low according to semantic similarity, and the top three items with the highest similarity are returned (if there are more than three items, the top three items are returned, otherwise all items are returned) and the corresponding water conservancy knowledge document sources are returned. The returned search results are summarized and analyzed using a large language model to organize the final output question and answer results.

[0041] Corresponding to the aforementioned embodiment of the method for semantic question answering of water conservancy knowledge, the present application also provides an embodiment of a device for semantic question answering of water conservancy knowledge.

[0042] Figure 2 A water conservancy knowledge semantic question-answering device is shown according to an exemplary embodiment, and the device includes: Preprocessing and classification module 1 is used to perform standardized preprocessing on various water conservancy knowledge documents and classify them according to business rules, historical scenarios, forecast and dispatch plans, expert experience, and water conservancy project safety; The disassembly processing module 2 is used to formulate disassembly processing rules and collection templates according to different types of water conservancy knowledge, segment and disassemble the water conservancy knowledge documents, extract water conservancy knowledge elements, form original water conservancy knowledge, and vectorize to form original vectorized water conservancy knowledge; Summarizing and refining module 3, used to summarize and refine the original water conservancy knowledge with the help of a large language model to form a summary overview of the original water conservancy knowledge, and vectorize it to form a summary overview of the original vectorized water conservancy knowledge, and then establish a corresponding mapping relationship with the original water conservancy knowledge and the original vectorized water conservancy knowledge; The review module 4 is used to verify the original water conservancy knowledge and the summary of the original water conservancy knowledge through manual review, form the verified water conservancy knowledge and the summary of the verified water conservancy knowledge, and vectorize them to form the verified vectorized water conservancy knowledge and the summary of the verified vectorized water conservancy knowledge, and update the mapping relationship; The retrieval module 5 is used to retrieve the summary of the verified vectorized water conservancy knowledge that is most similar to the user's question through a semantic similarity algorithm, find the corresponding verified water conservancy knowledge according to the updated mapping relationship, and return the retrieval result; The summary output module 6 is used to summarize the search results through a large language model to form a final answer and return it.

[0043] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0044] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0045] Accordingly, the present application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned water conservancy knowledge semantic question answering method. Figure 3 As shown in FIG. 1 , a hardware structure diagram of a water conservancy knowledge semantic question-answering device provided by an embodiment of the present invention is provided in any device with data processing capability, except Figure 3In addition to the processor and memory shown, any device with data processing capability in which the apparatus in the embodiment is located may also include other hardware, generally based on the actual functions of the device with data processing capability, which will not be described in detail.

[0046] Accordingly, the present application also provides a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by the processor, the water conservancy knowledge semantic question-answering method as described above is implemented. The computer-readable storage medium can be an internal storage unit of any device with data processing capabilities described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), an SD card, a flash card (Flash Card), etc. equipped on the device. Furthermore, the computer-readable storage medium can also include both an internal storage unit and an external storage device of any device with data processing capabilities. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and can also be used to temporarily store data that has been output or is to be output.

[0047] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the contents disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0048] It should be understood that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.

Claims

1. A semantic question answering method for water conservancy knowledge, characterized in that: include: Standardize and pre-process various water conservancy knowledge documents and classify them according to business rules, historical scenarios, forecast and dispatch plans, expert experience, and water conservancy project safety; According to different types of water conservancy knowledge, disassembly processing rules and collection templates are formulated to segment and disassemble water conservancy knowledge documents, extract water conservancy knowledge elements, form original water conservancy knowledge, and vectorize to form original vectorized water conservancy knowledge; Summarize and refine the original water conservancy knowledge with the help of a large language model to form a summary overview of the original water conservancy knowledge, and vectorize it to form a summary overview of the original vectorized water conservancy knowledge, and then establish a corresponding mapping relationship with the original water conservancy knowledge and the original vectorized water conservancy knowledge; By manual review, the original water conservancy knowledge and the summary of the original water conservancy knowledge are checked to form the checked water conservancy knowledge and the summary of the checked water conservancy knowledge, and they are vectorized to form the checked vectorized water conservancy knowledge and the summary of the checked vectorized water conservancy knowledge, and the mapping relationship is updated; Through the semantic similarity algorithm, the summary of the verified vectorized water conservancy knowledge that is most similar to the user's question is retrieved, and the corresponding verified water conservancy knowledge is found according to the updated mapping relationship, and the search results are returned; Based on the retrieval results, a large language model is used to summarize and form a final answer, which is then returned.

2. A water conservancy knowledge semantic question answering method according to claim 1, characterized in that: The business rules include water conservancy-related laws and regulations, rules and regulations, technical standards, management methods, and operating procedures; The historical scenarios include information on the execution of dispatch plans under specific historical conditions, rainstorms, plum rains, floods, typhoons, droughts, and flash flood disaster events; The forecast dispatching scheme includes reservoir forecast dispatching scheme, flood forecasting scheme, control and operation plan, and water resources dispatching scheme; The expert experience includes information on expert lists, and content in the form of text, formulas, graphics, and images formed through expert research and judgment during historical floods, droughts, flood prevention, and emergency rescue; The water conservancy project safety includes engineering risk hazards, hidden danger accident cases, engineering safety consultations, engineering safety appraisals, special safety inspections, emergency plans, engineering safety-related standards and specifications, and technical documents.

3. A water conservancy knowledge semantic question answering method according to claim 1, characterized in that: The disassembly processing rules and collection template are as follows: Business rules Water conservancy knowledge disassembly and processing rules: Disassemble and process according to clauses or chapter numbers. For laws, regulations, management methods, and system regulations, split by identifying the "Nth Article" in the document content, and take the content between "Nth Article" and "N+1th Article" as the "Nth Article" content. Each clause is disassembled into a water conservancy knowledge; for standards and specifications, split and disassemble according to the smallest first-level chapter number in the text; Historical scenario water conservancy knowledge collection template: contains information on the time, location, cause, impact, and disposal measures of historical events; Water conservancy knowledge collection template for forecast dispatching scheme: including basic information of water conservancy projects, dispatching objectives, dispatching principles, dispatching authority and other contents; Expert experience and water conservancy knowledge collection template: contains basic information of the expert list, educational background, work experience, honors and awards, scientific research results, and experience text, formulas, graphics and images provided by experts; Water conservancy project safety and water conservancy knowledge collection template: contains the time, location, cause, accident analysis, and preventive measures information related to hidden danger accident cases. For engineering safety standards and specifications, refer to the business rules and water conservancy knowledge disassembly and processing rules for disassembly and processing; The water conservancy knowledge documents that are not subject to the water conservancy knowledge disassembly and processing rules and collection templates of the above-mentioned business rules shall be disassembled and processed according to the general disassembly and processing method, which is to segment and disassemble the content of the water conservancy knowledge document according to semantic understanding.

4. A water conservancy knowledge semantic question answering method according to claim 3, characterized in that: The general class disassembly processing method is as follows: After reading the content of the water conservancy knowledge document, natural language processing technology is used and a semantic segmentation model is adopted to segment and disassemble the water conservancy knowledge document content to form original water conservancy knowledge, and then vectorized to form original vectorized water conservancy knowledge, which is stored in the vector database.

5. A water conservancy knowledge semantic question answering method according to claim 1, characterized in that: The original water conservancy knowledge is summarized and refined by means of a large language model to form a summary of the original water conservancy knowledge, and vectorized to form a summary of the original vectorized water conservancy knowledge, and then a corresponding mapping relationship is established with the original water conservancy knowledge and the original vectorized water conservancy knowledge, including: With the help of the large language model, in the form of prompt words, the large language model summarizes and refines the original water conservancy knowledge to form a summary of the original water conservancy knowledge; Vectorizing the original water conservancy knowledge summary to form an original vectorized water conservancy knowledge summary; The original water conservancy knowledge, the summary of the original water conservancy knowledge, the original vectorized water conservancy knowledge, and the summary of the original vectorized water conservancy knowledge are stored in the vector database, the corresponding water conservancy knowledge documents are marked, and the corresponding mapping relationship is established.

6. A water conservancy knowledge semantic question answering method according to claim 1, characterized in that: Through manual review and proofreading, the original water conservancy knowledge and the summary of the original water conservancy knowledge are verified to form the verified water conservancy knowledge and the summary of the verified water conservancy knowledge, and vectorization processing is performed respectively to form the verified vectorized water conservancy knowledge and the summary of the verified vectorized water conservancy knowledge, and the mapping relationship is updated, including: The original water conservancy knowledge and the summary of the original water conservancy knowledge after disassembly processing in the query vector database are manually reviewed and proofread, and the problematic original water conservancy knowledge and the summary of the original water conservancy knowledge are corrected, and irrelevant and redundant original water conservancy knowledge and the summary of the original water conservancy knowledge are deleted to form the verified water conservancy knowledge and the summary of the verified water conservancy knowledge; The verification water conservancy knowledge and the summary overview of the verification water conservancy knowledge are vectorized respectively to form the verification vectorized water conservancy knowledge and the summary overview of the verification vectorized water conservancy knowledge, and the verification water conservancy knowledge, the summary overview of the verification water conservancy knowledge, the verification vectorized water conservancy knowledge, and the summary overview of the verification vectorized water conservancy knowledge are saved to replace the original water conservancy knowledge, the summary overview of the original water conservancy knowledge, the original vectorized water conservancy knowledge, and the original vectorized water conservancy knowledge summary overview, and update the mapping relationship.

7. A water conservancy knowledge semantic question answering method according to claim 1, characterized in that: Through the semantic similarity algorithm, the summary of the verified vectorized water conservancy knowledge that is most similar to the user's question is retrieved. According to the updated mapping relationship, the corresponding verified water conservancy knowledge is found and the search results are returned, including: Vectorize the user input question, use the semantic similarity algorithm, and first search and match it with the summary of the verified vectorized water conservancy knowledge. If it is retrieved, find the corresponding verified water conservancy knowledge according to the updated mapping relationship and return the search result; If the search fails, the search is then performed based on the verified vectorized water conservancy knowledge. If the search is successful, the corresponding verified water conservancy knowledge is found based on the updated mapping relationship, and the search result is returned. If the search still fails, the result is returned as no result found.

8. A water conservancy knowledge semantic question-answering device, characterized in that: include: The preprocessing classification module is used to perform standardized preprocessing on various water conservancy knowledge documents and classify them according to business rules, historical scenarios, forecast scheduling plans, expert experience, and water conservancy project safety; The disassembly processing module is used to formulate disassembly processing rules and collection templates according to different types of water conservancy knowledge, segment and disassemble water conservancy knowledge documents, extract water conservancy knowledge elements, form original water conservancy knowledge, and vectorize to form original vectorized water conservancy knowledge; A summarizing and refining module is used to summarize and refine the original water conservancy knowledge with the help of a large language model to form a summary overview of the original water conservancy knowledge, and to vectorize it to form a summary overview of the original vectorized water conservancy knowledge, and then establish a corresponding mapping relationship with the original water conservancy knowledge and the original vectorized water conservancy knowledge; An audit module is used to verify the original water conservancy knowledge and the summary of the original water conservancy knowledge through manual audit, form the verified water conservancy knowledge and the summary of the verified water conservancy knowledge, and vectorize them to form the verified vectorized water conservancy knowledge and the summary of the verified vectorized water conservancy knowledge, and update the mapping relationship; The retrieval module is used to retrieve the summary of the verified vectorized water conservancy knowledge that is most similar to the user's question through a semantic similarity algorithm, find the corresponding verified water conservancy knowledge according to the updated mapping relationship, and return the retrieval result; The summary output module is used to summarize the retrieval results through a large language model to form a final answer and return it.

9. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Log information processing method and device, computer equipment and storage medium

    CN117909180A

  • Intelligent data asset checking method and system

    CN117909392A

  • Intelligent document question and answer method based on large model

    CN117932018A

  • Field priority control pollutant screening method based on text mining and risk assessment

    CN118656438A