Water affair knowledge retrieval method and system based on large language model

CN121743364BActive Publication Date: 2026-09-29HARBIN AEROSPACE STAR DATA SYST TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511923798.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-09-29
Estimated Expiration
2045-12-19

AI Technical Summary

Technical Problem

[0003]知识检索系统是水务企业实现知识沉淀、辅助决策的关键工具,可显著提升运维效率与决策科学性,在国内外供水、污水处置等企业中广泛应用;但现有水务领域知识检索系统的构建存在显著缺陷如下:(1)领域适配性不足,通用检索系统缺乏对水务专业术语的语义理解能力,易出现关键词匹配偏差;(2)定制化系统需人工编写数千条领域规则与词典,开发周期较长,且难以适配行业技术更新;(3)知识加工效率低下,传统系统依赖人工完成知识标引、分类及结构化处理,面对日均新增的海量运维数据与技术文档,易出现遗漏、错误,且知识更新滞后于业务需求;(4)检索精度与交互性差,多基于关键词匹配实现检索,无法理解用户模糊查询与多轮对话需求,且检索结果以文本罗列为主,缺乏可视化分析与关联推荐能力

Benefits of technology

[0036]本发明的有益效果如下:本发明提供的方法及系统,方便快捷、流程化明确、阶段清晰、模块清晰,无需人工完成大量知识标引与分类,避免人工编写数千条领域规则,降低传统的人工手动制作出现错误的概率,并且显著缩短系统开发周期;本发明提供的方法及系统,通过Sentence-BERT编码与Milvus存储,以及微调后大语言模型计算匹配得分,可降低传统关键词匹配检索的局限性,并可通过图表化的方式,直接将检索结果转化为直观分析结果;因此,本发明实现了水务领域知识检索系统的轻量化、快速化构建,提升知识检索的精准度与交互性,本发明能够为水务企业运营管理与决策提供高效支撑。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121743364B_ABST
    Figure CN121743364B_ABST
Patent Text Reader

Abstract

The application discloses a kind of water affair knowledge retrieval method and system based on large language model, belong to the water affair knowledge retrieval technical field based on semantic network.Solve the problem that the retrieval precision of traditional water affair knowledge retrieval method and system in prior art is lower and practicality is poorer;The application includes the following steps: S1.water affair knowledge acquisition, cleaning and enhancement are carried out by knowledge preprocessing module, and processed water affair data is obtained;S2.processed water affair data is input into model construction module, large language model adaptation and retrieval model integration are carried out by model construction module, and final retrieval result is obtained;S3.through interactive display module, user retrieval interactive operation and final retrieval result presentation are realized.The application effectively improves the accuracy and efficiency of knowledge retrieval, realizes the lightweight construction of water affair field knowledge retrieval system, and can be applied to water affair enterprise operation management and decision-making.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a water resources knowledge retrieval method and system, and more particularly to a water resources knowledge retrieval method and system based on a large language model, belonging to the field of water resources knowledge retrieval technology based on semantic networks. Background Technology

[0002] As a core support for urban infrastructure operations, the water sector encompasses multiple dimensions of business, including water supply scheduling, sewage treatment, pipeline network operation and maintenance, water quality monitoring, and flood and drought control. Its operation and management heavily rely on professional knowledge and the deep reuse of historical data. With the advancement of digital transformation in various regions, water companies have accumulated massive amounts of multi-source heterogeneous knowledge resources, including structured data (such as water quality testing reports, equipment ledgers, and pipeline vector data), unstructured data (such as operation and maintenance reports, technical specifications, and emergency plans), and semi-structured data (such as pipeline network monitoring logs and process parameter records).

[0003] Knowledge retrieval systems are key tools for water companies to achieve knowledge accumulation and assist decision-making. They can significantly improve operation and maintenance efficiency and decision-making scientificity. They are widely used in water supply, sewage treatment and other companies at home and abroad. However, the construction of existing knowledge retrieval systems in the water field has significant defects as follows: (1) Insufficient domain adaptability. General retrieval systems lack the ability to understand the semantics of water professional terms and are prone to keyword matching deviations. (2) Customized systems require manual writing of thousands of domain rules and dictionaries, which has a long development cycle and is difficult to adapt to industry technology updates. (3) Low knowledge processing efficiency. Traditional systems rely on manual completion of knowledge indexing, classification and structuring. Faced with the daily increase of massive operation and maintenance data and technical documents, omissions and errors are prone to occur, and knowledge updates lag behind business needs. (4) Poor retrieval accuracy and interactivity. Most retrieval is based on keyword matching and cannot understand the user's fuzzy query and multi-round dialogue needs. Moreover, the retrieval results are mainly text listings and lack visualization analysis and related recommendation capabilities.

[0004] Therefore, there is an urgent need for a water knowledge retrieval method and system based on a large language model that can quickly adapt to the characteristics of the water sector, automate knowledge processing, and achieve accurate interactive retrieval. Summary of the Invention

[0005] A brief overview of the invention is given below to provide a basic understanding of certain aspects of it. It should be understood that this overview is not an exhaustive summary of the invention. It is not intended to identify key or essential parts of the invention, nor is it intended to limit the scope of the invention. Its purpose is merely to present certain concepts in a simplified form as a prelude to the more detailed description that follows.

[0006] In view of this, in order to solve the problems of low retrieval accuracy and poor practicality of traditional water affairs knowledge retrieval methods and systems in the prior art, the present invention provides a water affairs knowledge retrieval method and system based on a large language model.

[0007] Technical solution one is as follows: A water resources knowledge retrieval method based on a large language model, comprising the following steps:

[0008] S1. Water affairs knowledge is collected, cleaned, and enhanced through the knowledge preprocessing module to obtain processed water affairs data;

[0009] S2. Input the processed water data into the model building module, and use the model building module to adapt the large language model and integrate the retrieval model to obtain the final retrieval results;

[0010] S3. The interactive display module enables users to perform search operations and present the final search results.

[0011] Furthermore, step S1 includes the following steps:

[0012] S11. Configure the crawler interface and the enterprise system interface through the knowledge acquisition unit of the knowledge preprocessing module to perform batch collection of multi-source data;

[0013] In S11, the Scrapy tool is used to crawl industry standards, literature, and water quality data of publicly available materials. At the same time, the REST interface is used to connect with the company's existing water system to collect structured data such as equipment models and water quality test results, unstructured data such as formatted operation and maintenance reports and emergency plans, and semi-structured data of pipeline monitoring in custom format, forming a water knowledge set.

[0014] S12. The data cleaning unit of the knowledge preprocessing module has a built-in regular expression library and text parsing tool to remove redundant information and standardize the format of the remaining data;

[0015] In step S12, regular expressions are used to remove duplicate entries and redundant information in advertising text, and NLTK tools are used for word segmentation and part-of-speech tagging. Structured data is formatted uniformly and stored in JSON format. Unstructured documents are extracted from text and tables using PDFMiner to achieve data standardization. Semi-structured data is formatted uniformly and stored in JSON format.

[0016] S13. By calling the large language model interface through the semantic enhancement unit of the knowledge preprocessing module, information extraction, event structuring and knowledge association are completed;

[0017] In step S13, core terms in the water sector are compiled into an Excel table. Based on a large language model, triples of [process name - applicable scenario - operation parameters] are extracted from process documents. The operation and maintenance logs are converted into the format of [time - location - equipment - event - handling]. Finally, two fields, definition and attribute, are added to the terms.

[0018] Furthermore, step S2 includes the following steps:

[0019] S21. Samples are automatically filtered through the dataset building unit of the model building module to generate three types of fine-tuning data: question-answer pairs, text summaries, and terminology comparisons, forming a fine-tuning dataset for the water sector.

[0020] S22. By integrating the LoRA framework into the large language model fine-tuning unit of the model building module, the model parameters are configured and training is monitored to obtain the fine-tuned large language model.

[0021] In S22, the LoRA framework is used to fine-tune the basic large language model, freeze the bottom general semantic layer, train only the top domain adaptation layer, set the training rounds and learning rate, and optimize the parameters with the cross-entropy loss function to achieve accurate understanding of domain semantics.

[0022] The model parameter update mechanism in the fine-tuning unit of the large language model is as follows: The weight matrix of the Transformer layer of the basic large language model is updated... Perform low-rank decomposition. Where d is the input dimension and k is the output dimension, a low-rank matrix is ​​introduced. and , , r represents the rank value. The weight update formula is expressed as: W = +A× ,in, This indicates that the introduced low-rank matrix B has been trained for T epochs, and the weight matrix is ​​frozen during the training of the basic large language model. Only update the low-rank matrix. and This reduces the number of training parameters and computational costs.

[0023] The training termination condition for the basic large language model is expressed as follows: when the cross-entropy loss value converges to a preset threshold or reaches the maximum number of training rounds, training stops, and the fine-tuned large language model is obtained.

[0024] S23. Based on the finely tuned large language model, a secondary retrieval model is constructed using Sentence-BERT encoding and Milvus storage through the retrieval model unit of the model building module, and the final retrieval results are output.

[0025] In S23, for the vector retrieval layer of the secondary retrieval model, knowledge is encoded into a 768-dimensional vector by Sentence-BERT and stored in the Milvus vector database. When a user queries, a query vector is generated, and Top-50 candidate knowledge is returned by cosine similarity matching.

[0026] For the semantic re-ranking layer of the second-level retrieval model, the query text Q is compared with the candidate knowledge text. The finely tuned large language model is input, and the query-knowledge matching score S is calculated using the scoring formula: S = 10 × σ( (Q, )),in, This is a fine-tuned large language model in the model building module. σ is the Sigmoid function. The model output is mapped to the [0,1] interval and then scaled to the set score range. The Top-10 final search results are returned in descending order of score.

[0027] Furthermore, step S3 includes the following steps:

[0028] S31. The interactive display module provides users with an entry point for knowledge retrieval and management through its search interaction unit;

[0029] In S31, for knowledge management, it supports batch uploading of documents in multiple formats, and the large language model automatically completes the classification and storage of knowledge such as water quality, pipe network, and emergency response.

[0030] For intelligent retrieval, three retrieval modes are provided: keyword, natural language, and multi-turn dialogue. Multi-turn dialogue supports contextual memory and follow-up questions based on previous information.

[0031] S32. Through the visualization unit of the interactive display module, water quality trend charts, pipeline fault heat maps, and knowledge base statistical charts are generated based on the ECharts framework, and chart export is supported.

[0032] Technical Solution 2 is as follows: A water resources knowledge retrieval system based on a large language model, used to execute the water resources knowledge retrieval method based on a large language model as described in Technical Solution 1, including a knowledge preprocessing module, a model building module, and an interactive display module connected in sequence;

[0033] The knowledge preprocessing module includes a knowledge acquisition unit, a data cleaning unit, and a semantic enhancement unit connected in sequence.

[0034] The model building module includes a dataset building unit, a large language model fine-tuning unit, and a retrieval model unit connected in sequence.

[0035] The interactive display module includes a search interaction unit and a visualization unit connected in sequence.

[0036] The beneficial effects of this invention are as follows: The method and system provided by this invention are convenient, fast, and have a clear process, distinct stages, and clear modules. They eliminate the need for manual completion of extensive knowledge indexing and classification, avoid manually writing thousands of domain rules, reduce the probability of errors in traditional manual processes, and significantly shorten the system development cycle. The method and system provided by this invention, through Sentence-BERT encoding and Milvus storage, as well as the calculation of matching scores using a fine-tuned large language model, can reduce the limitations of traditional keyword matching retrieval and directly transform retrieval results into intuitive analysis results through graphical representation. Therefore, this invention achieves lightweight and rapid construction of a knowledge retrieval system in the water sector, improves the accuracy and interactivity of knowledge retrieval, and can provide efficient support for the operation, management, and decision-making of water enterprises. Attached Figure Description

[0037] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:

[0038] Figure 1 This is a flowchart illustrating a water resources knowledge retrieval method based on a large language model.

[0039] Figure 2 This is a schematic diagram of the structure of a water resources knowledge retrieval system based on a large language model.

[0040] Attached diagrams: 1. Knowledge preprocessing module; 2. Model building module; 3. Interactive display module. Detailed Implementation

[0041] To make the technical solutions and advantages of the embodiments of the present invention clearer, the exemplary embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not an exhaustive list of all embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0042] Example 1: Reference Figure 1 and Figure 2 This embodiment describes a water resources knowledge retrieval method based on a large language model, which specifically includes the following steps:

[0043] S1. Water affairs knowledge is collected, cleaned, and enhanced through the knowledge preprocessing module to obtain processed water affairs data;

[0044] S2. Input the processed water data into the model building module, and use the model building module to adapt the large language model and integrate the retrieval model to obtain the final retrieval results;

[0045] S3. The interactive display module enables users to perform search operations and present the final search results.

[0046] Furthermore, step S1 includes the following steps:

[0047] S11. Configure the crawler interface and the enterprise system interface through the knowledge acquisition unit of the knowledge preprocessing module to perform batch collection of multi-source data;

[0048] In S11, the Scrapy tool is used to crawl industry standards, literature, and water quality data of publicly available materials. At the same time, the REST interface is used to connect with the company's existing water system to collect structured data such as equipment models and water quality test results, unstructured data such as formatted operation and maintenance reports and emergency plans, and semi-structured data of pipeline monitoring in custom format, forming a water knowledge set.

[0049] S12. The data cleaning unit of the knowledge preprocessing module has a built-in regular expression library and text parsing tool to remove redundant information and standardize the format of the remaining data;

[0050] In step S12, regular expressions are used to remove duplicate entries and redundant information in advertising text, and NLTK tools are used for word segmentation and part-of-speech tagging. Structured data is formatted uniformly and stored in JSON format. Unstructured documents are extracted from text and tables using PDFMiner to achieve data standardization. Semi-structured data is formatted uniformly and stored in JSON format.

[0051] S13. By calling the large language model interface through the semantic enhancement unit of the knowledge preprocessing module, information extraction, event structuring and knowledge association are completed;

[0052] In step S13, an Excel table containing at least 2,000 core terms in the water sector is compiled. Based on a large language model, a triplet of [process name - applicable scenario - operation parameters] is extracted from the process document. The operation and maintenance log is converted into the format of [time - location - equipment - event - handling]. Finally, two fields, definition and attribute, are added to the terms.

[0053] Specifically, during the knowledge acquisition process, publicly available water supply-related data was crawled, and the enterprise's SCADA system and operation and maintenance platform were connected via the HTTP RERT interface to collect 200,000 water quality data, 50,000 pipeline operation and maintenance work orders, and 100 flood control emergency plans to form a knowledge set.

[0054] During the data cleaning process, regular expressions were used to remove duplicate equipment information from the work orders, and the "Emergency Team Responsibilities" table in the emergency plan was extracted using PDFMiner. The "Detection Time" of the water quality data was then standardized to the format "YYYY-MM-DD HH:MM".

[0055] During the knowledge enhancement process, the Llama2-7B model is invoked to extract the triplet "pipeline leakage - urban DN500 - pipe fitting replacement" from the maintenance work order, and the log is transformed into structured events to supplement the "ultrafiltration membrane" with attributes such as "replacement cycle" and "cleaning method".

[0056] Furthermore, step S2 includes the following steps:

[0057] S21. Samples are automatically filtered through the dataset building unit of the model building module to generate three types of fine-tuning data: question-answer pairs, text summaries, and terminology comparisons, forming a fine-tuning dataset for the water sector.

[0058] Specifically, at least 100,000 high-quality samples are automatically selected from augmented knowledge;

[0059] S22. By integrating the LoRA framework into the large language model fine-tuning unit of the model building module, the model parameters are configured and training is monitored to obtain the fine-tuned large language model.

[0060] In S22, the LoRA (Low-Rank Adaptation) framework is used to fine-tune the basic large language model, freeze the bottom general semantic layer, train only the top domain adaptation layer, set the training rounds to 5-8 rounds and the learning rate to 2e-4, and optimize the parameters with the cross-entropy loss function to achieve accurate understanding of domain semantics.

[0061] The model parameter update mechanism in the fine-tuning unit of the large language model is as follows: The weight matrix of the Transformer layer of the basic large language model is updated... Perform low-rank decomposition. Where d is the input dimension and k is the output dimension, a low-rank matrix is ​​introduced. and , , r represents the rank value. The weight update formula is expressed as: W = +A× ,in, This indicates that the introduced low-rank matrix B has been trained for T epochs, and the weight matrix is ​​frozen during the training of the basic large language model. Only update the low-rank matrix. and This reduces the number of training parameters and computational costs.

[0062] The training termination condition for the basic large language model is expressed as follows: when the cross-entropy loss value converges to a preset threshold or reaches the maximum number of training rounds, training stops, and the fine-tuned large language model is obtained.

[0063] S23. Based on the finely tuned large language model, a secondary retrieval model is constructed using Sentence-BERT encoding and Milvus storage through the retrieval model unit of the model building module, and the final retrieval results are output.

[0064] In S23, for the vector retrieval layer of the secondary retrieval model, knowledge is encoded into a 768-dimensional vector by Sentence-BERT and stored in the Milvus vector database. When a user queries, a query vector is generated, and Top-50 candidate knowledge is returned by cosine similarity matching.

[0065] For the semantic re-ranking layer of the second-level retrieval model, the query text Q is compared with the candidate knowledge text. The finely tuned large language model is input, and the query-knowledge matching score S is calculated using the scoring formula: S = 10 × σ( (Q, )),in, This is a fine-tuned large language model in the model building module. σ is the Sigmoid function. The model output is mapped to the [0,1] interval and then scaled to a set score range (score range 0-10 points). The Top-10 final search results are returned in descending order of score.

[0066] Specifically, in this embodiment, 120,000 samples were screened, including 80,000 question-answer pairs, such as "Q: Reasons for low pipeline pressure, A: Leakage, insufficient pump head", 20,000 summaries, and 20,000 terminology comparisons, to construct a fine-tuning dataset;

[0067] During the fine-tuning of the basic large language model, LoRA technology was used to fine-tune Llama2-7B, freezing the weight moments W0 of the bottom 20 layers, and only introducing low-rank matrices A (dimension d×8) and B (dimension 8×k) to the top 4 layers for low-rank decomposition, updating the weights, setting 6 training rounds and a learning rate of 2e-4, and finally the loss converged to below 0.05.

[0068] In constructing the retrieval model, Sentence-BERT (all-MiniLM-L6-v2) is used to encode knowledge as a 768-dimensional vector, stored in Milvus 2.3.0. When a user queries, the vector retrieval first returns 50 candidates, and then the fine-tuned large language model calculates the results according to the formula S=10×σ(LLM). fine-tuned Calculate the scores for (Q,Xi) and sort them, then output the Top-10 results.

[0069] Furthermore, step S3 includes the following steps:

[0070] S31. The interactive display module provides users with an entry point for knowledge retrieval and management through its search interaction unit;

[0071] In S31, for knowledge management, it supports batch uploading of documents in multiple formats, and the large language model automatically completes the classification and storage of knowledge such as water quality, pipe network, and emergency response.

[0072] For intelligent retrieval, three retrieval modes are provided: keyword, natural language, and multi-turn dialogue. Multi-turn dialogue supports contextual memory and follow-up questions based on previous information.

[0073] S32. Through the visualization unit of the interactive display module, water quality trend charts, pipeline fault heat maps, and knowledge base statistical charts are generated based on the ECharts framework, and chart export is supported.

[0074] Specifically, the core of the interactive display module is deployed based on Spring Cloud;

[0075] Knowledge management supports batch uploading of Excel water quality data and PDF contingency plans, and the large language model automatically classifies them into "water quality knowledge" and "pipeline network knowledge";

[0076] The intelligent search provides a search box, and multi-turn dialogues can be linked in the form of "reason → measure" for querying.

[0077] The visualization function is based on the Vue front-end framework and the Element-ui framework, and displays the analysis results in a web-based manner. It also uses the Echarts framework to draw the required charts, presenting the analysis results in an intuitive and clear graphical way. The analysis results are all displayed as stacked bar charts in Echarts, and can generate "COD trend chart for the past 30 days" and "pipeline fault heat map", and supports PNG export.

[0078] Example 2: Reference Figure 2 This embodiment describes a water resources knowledge retrieval system based on a large language model, used to execute the water resources knowledge retrieval method based on a large language model described in Embodiment 1. The system includes a knowledge preprocessing module 1, a model building module 2, and an interactive display module 3 connected in sequence.

[0079] The knowledge preprocessing module 1 includes a knowledge acquisition unit, a data cleaning unit, and a semantic enhancement unit connected in sequence.

[0080] The model building module 2 includes a dataset building unit, a large language model fine-tuning unit, and a retrieval model unit connected in sequence.

[0081] The interactive display module 3 includes a search interaction unit and a visualization unit connected in sequence.

[0082] Although the invention has been described with reference to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and instructional purposes, and not for the purpose of interpreting or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative and not restrictive, and the scope of the invention is defined by the appended claims.

Claims

1. A water resources knowledge retrieval method based on a large language model, characterized in that, Includes the following steps: S1. Water affairs knowledge is collected, cleaned, and enhanced through the knowledge preprocessing module to obtain processed water affairs data; S2. Input the processed water data into the model building module, and use the model building module to adapt the large language model and integrate the retrieval model to obtain the final retrieval results; S3. The interactive display module enables users to perform search operations and present the final search results. S13. By calling the large language model interface through the semantic enhancement unit of the knowledge preprocessing module, information extraction, event structuring and knowledge association are completed; In step S13, core terms in the water sector are compiled into an Excel table. Based on a large language model, triples of [process name - applicable scenario - operation parameters] are extracted from process documents. The operation and maintenance logs are converted into the format of [time - location - equipment - event - handling]. Finally, two fields, definition and attribute, are added to the terms. S2 includes the following steps: S21. Samples are automatically filtered through the dataset building unit of the model building module to generate three types of fine-tuning data: question-answer pairs, text summaries, and terminology comparisons, forming a fine-tuning dataset for the water sector. S22. By integrating the LoRA framework into the large language model fine-tuning unit of the model building module, the model parameters are configured and training is monitored to obtain the fine-tuned large language model. In S22, the LoRA framework is used to fine-tune the basic large language model, freeze the bottom general semantic layer, train only the top domain adaptation layer, set the training rounds and learning rate, and optimize the parameters with the cross-entropy loss function to achieve accurate understanding of domain semantics. The model parameter update mechanism in the fine-tuning unit of the large language model is as follows: The weight matrix of the Transformer layer of the basic large language model is updated... Perform low-rank decomposition. Where d is the input dimension and k is the output dimension, a low-rank matrix is ​​introduced. and , , Let r represent the rank, r≪min(d,k), and the weight update formula is expressed as: W= +A× ,in, This indicates that the introduced low-rank matrix B has been trained for T epochs, and the weight matrix is ​​frozen during the training of the basic large language model. Only update the low-rank matrix. and This reduces the number of training parameters and computational costs. The training termination condition for the basic large language model is expressed as follows: when the cross-entropy loss value converges to a preset threshold or reaches the maximum number of training rounds, training stops, and the fine-tuned large language model is obtained. S23. Based on the finely tuned large language model, a secondary retrieval model is constructed using Sentence-BERT encoding and Milvus storage through the retrieval model unit of the model building module, and the final retrieval results are output. In S23, for the vector retrieval layer of the secondary retrieval model, knowledge is encoded into a 768-dimensional vector by Sentence-BERT and stored in the Milvus vector database. When a user queries, a query vector is generated, and Top-50 candidate knowledge is returned by cosine similarity matching. For the semantic re-ranking layer of the second-level retrieval model, the query text Q is compared with the candidate knowledge text. The finely tuned large language model is input, and the query-knowledge matching score S is calculated using the scoring formula: S = 10 × σ( (Q, )),in, This is a fine-tuned large language model in the model building module. σ is the Sigmoid function. The model output is mapped to the [0,1] interval and then scaled to the set score range. The Top-10 final search results are returned in descending order of score.

2. The water resources knowledge retrieval method based on a large language model according to claim 1, characterized in that, S1 includes the following steps: S11. Configure the crawler interface and the enterprise system interface through the knowledge acquisition unit of the knowledge preprocessing module to perform batch collection of multi-source data; In S11, the Scrapy tool is used to crawl industry standards, literature, and water quality data of publicly available materials. At the same time, the REST interface is used to connect with the company's existing water system to collect structured data such as equipment models and water quality test results, unstructured data such as formatted operation and maintenance reports and emergency plans, and semi-structured data of pipeline monitoring in custom format, forming a water knowledge set. S12. The data cleaning unit of the knowledge preprocessing module has a built-in regular expression library and text parsing tool to remove redundant information and standardize the format of the remaining data; In step S12, regular expressions are used to remove duplicate entries and redundant information in advertising text. NLTK tools are used for word segmentation and part-of-speech tagging. Structured data is formatted uniformly and stored in JSON format. Unstructured documents are extracted from text and tables using PDFMiner to achieve data standardization. Semi-structured data is formatted uniformly and stored in JSON format.

3. The water resources knowledge retrieval method based on a large language model according to claim 2, characterized in that, S3 includes the following steps: S31. The interactive display module provides users with an entry point for knowledge retrieval and management through its search interaction unit; In S31, for knowledge management, it supports batch uploading of documents in multiple formats, and the large language model automatically completes the classification and storage of water quality, pipe network and emergency knowledge; For intelligent retrieval, three retrieval modes are provided: keyword, natural language, and multi-turn dialogue. Multi-turn dialogue supports contextual memory and follow-up questions based on previous information. S32. Through the visualization unit of the interactive display module, water quality trend charts, pipeline fault heat maps, and knowledge base statistical charts are generated based on the ECharts framework, and chart export is supported.

4. A water resources knowledge retrieval system based on a large language model, characterized in that, The method for performing a water resources knowledge retrieval method based on a large language model as described in any one of claims 1-3 includes a knowledge preprocessing module (1), a model building module (2), and an interactive display module (3) connected in sequence. The knowledge preprocessing module (1) includes a knowledge acquisition unit, a data cleaning unit, and a semantic enhancement unit connected in sequence; The model building module (2) includes a dataset building unit, a large language model fine-tuning unit, and a retrieval model unit connected in sequence; The interactive display module (3) includes a retrieval interaction unit and a visualization unit connected in sequence.

Citation Information

Patent Citations

  • Dynamic knowledge retrieval enhancement method based on large language model

    CN120407570A

  • Traditional Chinese medicine knowledge question-answering system based on fine-tuning large model and dual retrieval enhancement

    CN120596593A