A Method and System for Routine Auxiliary Monitoring of Natural Resources Based on Large Language Models

By constructing a routine monitoring and support system for natural resources using a large language model, the problem of reliance on manual labor in traditional monitoring methods has been solved, enabling automated, rapid, and accurate monitoring and analysis, thereby improving efficiency and security.

CN118364807BActive Publication Date: 2025-10-28GUANGDONG SURVEYING & MAPPING ENG CO
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410523625.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-28
Publication Date
2025-10-28
Estimated Expiration
2044-04-28

AI Technical Summary

Technical Problem

Traditional natural resource monitoring models rely on manual intervention, which cannot meet the requirements for rapid processing and accurate analysis of large-scale, multi-batch monitoring data. Furthermore, they require highly skilled technical personnel, resulting in low efficiency and time-consuming and labor-intensive data processing.

Method used

Using a large language model as the core, task-oriented dialogue as the main thread, and a local knowledge base as the foundation, a normalized monitoring and auxiliary system for natural resources is constructed. Through data preprocessing, model parameter adjustment and optimization, automated analysis and intelligent auxiliary monitoring are achieved.

Benefits of technology

It improves the accuracy and efficiency of monitoring, provides an intelligent interactive method, enables rapid response and accurate analysis of changes in natural resources, enhances the work efficiency and quality of results for staff, and ensures data privacy and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118364807B_ABST
    Figure CN118364807B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for routine auxiliary monitoring of natural resources based on a large language model, belonging to the field of natural resource monitoring technology. The method involves: localizing the model deployment; acquiring relevant data and information on natural resource monitoring, and preprocessing the data and information to obtain a dataset; constructing a local knowledge base for routine monitoring of natural resources using a large language model; setting and adjusting the parameters of the large language model; fine-tuning the parameters; responding to the user's selected knowledge base and input question, calling the large language model to obtain the result of the input question; comprehensively evaluating the system's performance, and improving and optimizing the system based on the evaluation results; not only improving the accuracy and efficiency of monitoring, but also enhancing user experience and system performance, providing strong technical support for the protection and management of natural resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural resource monitoring technology, and in particular to a method and system for routine auxiliary monitoring of natural resources based on a large language model. Background Technology

[0002] Routine monitoring of natural resources is a crucial component of natural resource management. Its purpose is to promptly grasp the status and changing trends of natural resources, providing a basis for decision-making regarding the scientific and rational utilization and management of these resources. Routine monitoring work involves extracting change patches from comprehensive sensing data and operational management data. This is then processed through stages such as individual patch identification in the office, field investigation and evidence collection, and internal review, ultimately forming a routine monitoring database. Based on the monitoring results, scientific analysis and objective evaluation are conducted, resulting in a series of routine monitoring maps and an annual summary report.

[0003] However, traditional working methods face many challenges, such as the large number of map features, their complexities, and numerous review rules, requiring a high level of expertise from technical personnel. Furthermore, the analysis and evaluation work involves the collection and processing of large amounts of data and information, which is time-consuming and labor-intensive. In addition, existing technical solutions rely on manual intervention, which cannot meet the needs for rapid processing and accurate analysis of large-scale, multi-batch monitoring data.

[0004] To address these issues, this invention proposes a method and system for routine monitoring of natural resources, centered on a large language model, guided by task-oriented dialogue, and based on a local knowledge base. This system effectively utilizes the powerful feature learning and analysis capabilities of the large language model, and, based on the local knowledge base, enables functions such as verifying land cover types and assisting in the analysis and evaluation of natural resource changes, providing "intellectual" support for the management and protection of natural resources. Summary of the Invention

[0005] The purpose of this invention is to provide a method and system for routine auxiliary monitoring of natural resources based on a large language model, which improves the accuracy and efficiency of monitoring, enhances user experience and system performance, and provides strong technical support for the protection and management of natural resources.

[0006] The objective of this invention is achieved through the following technical solution:

[0007] This application proposes a method for routine auxiliary monitoring of natural resources based on a large language model, the method comprising:

[0008] Configure the model and deploy it locally by configuring the terminal environment;

[0009] Acquire relevant data and information on natural resource monitoring, and preprocess the relevant data and information to obtain a dataset; the dataset includes a txt dataset and a json dataset;

[0010] Using the dataset, a local knowledge base for routine monitoring of natural resources is constructed using a large language model; and the text in the dataset is converted into text vectors.

[0011] Set and adjust the parameters of the large language model;

[0012] Fine-tuning of the parameters of the large language model;

[0013] In response to the user's selected knowledge base and input question, the large language model is invoked to obtain the result of the input question and returned to the dialog interface;

[0014] By comprehensively analyzing user feedback, system logs, and test reports, the system's performance is fully evaluated, and improvements and optimizations are made based on the evaluation results.

[0015] Preferably, the step of acquiring relevant data and information on natural resource monitoring, and preprocessing the relevant data and information to obtain a dataset, includes:

[0016] Acquire relevant data and information on natural resource monitoring, including routine monitoring patch data, review rule documents, and other relevant information;

[0017] The relevant data and information are preprocessed, including data cleaning, text segmentation, annotation, and augmentation.

[0018] The preprocessed data is then used to form a dataset.

[0019] Preferably, the step of constructing a local knowledge base for routine monitoring of natural resources using the dataset and a large language model, and converting the text in the dataset into text vectors, includes:

[0020] The preprocessed txt dataset is input into a large language model to construct a local knowledge base for routine monitoring of natural resources.

[0021] The text in the txt dataset is segmented, and the segmented text is converted into text vectors.

[0022] Preferably, the parameters of the large language model include: knowledge base relevance threshold, number of knowledge base content entries obtained, and whether context association is enabled.

[0023] Preferably, the fine-tuning of the large language model parameters includes:

[0024] Replace the training, validation, and test files in the P-Tuning framework directory with the path to the JSON dataset;

[0025] Set the maximum length of the input and output text sequences in the JSON file.

[0026] Preferably, the step of responding to the user-selected knowledge base and input question by invoking the large language model to obtain the result of the input question and returning it to the dialogue interface includes:

[0027] Obtain the user's chosen knowledge base and input questions;

[0028] Transform the input question into an input vector;

[0029] The input vector is matched with the text vector to obtain the relevant text;

[0030] Based on the relevant text, an answer is generated using a large language model.

[0031] Preferably, the step of evaluating system performance through comprehensive analysis of user feedback, system logs, and test reports, and improving and optimizing the system based on the evaluation results, includes:

[0032] Obtain user feedback through the user feedback interface;

[0033] The system's performance is evaluated using user feedback, system logs, and test reports; the evaluation results are then obtained.

[0034] The system was improved and optimized based on the evaluation results.

[0035] This application proposes a routine auxiliary monitoring system for natural resources based on a large language model, the system comprising:

[0036] The model deployment module is used to configure models and deploy them locally through terminal environment configuration.

[0037] The dataset acquisition module is used to acquire natural resource monitoring-related data and information, and to preprocess the data and information to obtain a dataset; the dataset includes a txt dataset and a json dataset;

[0038] The knowledge base building module is used to construct a local knowledge base for routine monitoring of natural resources using the dataset and a large language model; and to convert the text in the dataset into text vectors.

[0039] The parameter setting module is used to set and adjust the parameters of the large language model;

[0040] The parameter fine-tuning module is used to fine-tune the parameters of the large language model;

[0041] The knowledge base question answering module is used to respond to the user's selected knowledge base and input question, call the large language model to obtain the result of the input question, and return it to the dialogue interface.

[0042] The model optimization module is used to comprehensively evaluate the system's performance by analyzing user feedback, system logs, and test reports, and to improve and optimize the system based on the evaluation results.

[0043] Thirdly, this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described in this application, or to implement the functions of the system described in this application.

[0044] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by at least one processor, implements the steps of any of the methods described in this application, or implements the functions of the system described in this application.

[0045] Compared with existing technologies, the beneficial effects of this invention include at least the following: Based on the ChatGLM2-6B large language model, this invention achieves automated analysis, enabling rapid response and accurate analysis and assessment of changes in natural resources. Through automated review and analysis opinion generation functions, it improves the work efficiency and quality of results for staff. This invention establishes a local knowledge base for routine natural resource monitoring, including review rules for routine monitoring patches, routine monitoring data, etc. Through systematic management and application, it provides convenient and comprehensive intelligent assistance for routine natural resource monitoring work. Staff can rely on the system to obtain key information, identify potential problems, and obtain feasibility analyses generated by the system. It is highly operable, enabling real-time interaction with staff through a dialogue interface module, understanding work needs, and providing relevant information and suggestions. This intelligent interaction method can provide coherent answers and automatically customize personalized services based on user history and preferences to better meet user needs. Based on extensive preprocessed data training and fine-tuning, it can accurately identify and assess patch types and natural resource changes. This invention can analyze resource changes and provide the source evidence for answers while generating them, offering more accurate and comprehensive support for relevant decision-making. Through in-depth analysis of monitoring targets and dataset characteristics, and continuous iterative model optimization, the accuracy of text segmentation can be significantly improved, ensuring that key information is correctly extracted and preserved. Accurate text segmentation helps build a high-quality local knowledge base for routine natural resource monitoring, providing a reliable foundation for subsequent knowledge extraction, reasoning, and decision support. This invention achieves localized deployment, storing the knowledge base and question-and-answer data locally, avoiding the risk of data leakage and ensuring the privacy and security of routine natural resource monitoring data. This invention has strong scalability; the knowledge base management module facilitates continuous knowledge updates, and model parameters can be set and fine-tuned according to actual needs, making it suitable for different routine natural resource monitoring tasks or similar projects. Attached Figure Description

[0046] Figure 1 This is a schematic diagram of routine auxiliary monitoring of natural resources based on a large language model, according to an embodiment of the present invention.

[0047] Figure 2 This is a schematic diagram of a routine auxiliary monitoring system for natural resources based on a large language model, according to an embodiment of the present invention.

[0048] Figure 3 This is a schematic diagram of the process of generating answers based on a large language model according to an embodiment of the present invention. Detailed Implementation

[0049] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, they are provided to make the invention more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and therefore repeated descriptions of them will be omitted.

[0050] The terms used to express position and direction in this invention are illustrated with reference to the accompanying drawings, but changes can be made as needed, and all such changes are included within the scope of protection of this invention.

[0051] This application provides a method for routine auxiliary monitoring of natural resources based on a large language model, the method comprising:

[0052] Configure the model and deploy it locally via computer / terminal environment configuration. Before installing and deploying ChatGLM2-6B, LangChain, and P-Tuning, you must first configure the computer environment, check that the graphics card driver supports the highest CUDA version, download and install Python 3.10, the appropriate CUDA version, PyTorch version, and Transformers version, and then complete the local deployment of the model and connect it to the knowledge base by downloading the installation packages and replacing and modifying them.

[0053] Acquire relevant data and information on natural resource monitoring, and preprocess the relevant data and information to obtain a dataset; the dataset includes a txt dataset and a json dataset;

[0054] Using the dataset, a local knowledge base for routine monitoring of natural resources is constructed using a large language model; and the text in the dataset is converted into text vectors.

[0055] Set and adjust the parameters of the large language model;

[0056] Fine-tuning of the parameters of the large language model;

[0057] In response to the user's selected knowledge base and input question, the large language model is invoked to obtain the result of the input question and returned to the dialog interface.

[0058] By comprehensively analyzing user feedback, system logs, and test reports, the system's performance is fully evaluated, and improvements and optimizations are made based on the evaluation results.

[0059] The working principle and effects of the above technical solution are as follows: To ensure the model can run normally in a specific hardware and software environment, a suitable environment for the large language model is configured on the computer, and the model is configured and deployed locally; data and materials related to natural resource monitoring are collected, including TXT and JSON datasets; the datasets include map data, review rule documents, and other documents; the collected data undergoes preprocessing operations such as cleaning, labeling, and augmentation to improve data quality and usability; using the preprocessed dataset, a local knowledge base for routine natural resource monitoring is constructed through the large language model; the text in the dataset is converted into text vectors, which helps the model understand and process natural language queries; the parameters of the large language model are set and adjusted, such as the knowledge base relevance score threshold, the number of knowledge base content entries to be acquired, and whether context association is enabled. The model is fine-tuned to optimize its performance on specific monitoring tasks. Fine-tuning may involve using specific techniques, such as P-Tuning, to adjust the model's parameters; when a user selects a knowledge base and enters a question, the system transforms the user's question into an input vector and matches it with text vectors in the knowledge base; based on the matched relevant text, the system generates an answer using a large language model and returns it to the user; the system's performance is comprehensively evaluated by analyzing user feedback, system logs, and test reports; and the system is improved and optimized based on the evaluation results to enhance its accuracy and efficiency.

[0060] By leveraging the powerful capabilities of large language models to process and analyze natural resource monitoring data, an efficient and accurate auxiliary monitoring tool can be provided. Through continuous data processing, model training, and parameter tuning, the tool can better understand and respond to user queries, thus supporting the management and protection of natural resources.

[0061] In some embodiments, acquiring natural resource monitoring-related data and information, and preprocessing the data and information to obtain a dataset, includes:

[0062] Acquire relevant data and information on natural resource monitoring, including routine monitoring patch data, review rule documents, and other relevant information;

[0063] The relevant data and materials are preprocessed, including data cleaning, text segmentation, annotation, and expansion. Other data and materials are organized into TXT format according to attributes such as year, administrative region, and land use type. Then, the TXT files undergo preprocessing such as text segmentation, part-of-speech tagging, and adding serial numbers. For content that is difficult to identify, it is organized into the format {"content":"","summary":""} and saved as a JSON file.

[0064] The preprocessed data is then used to form a dataset.

[0065] The working principle of the above technical solution is as follows: It acquires relevant data and information for natural resource monitoring, including routine monitoring patch data, review rule documents, and other relevant materials. A patch is a concept in remote sensing and digital image processing, referring to a local area in an image, typically a relatively continuous and uniform region where pixels have the same or similar characteristics. Routine natural resource monitoring utilizes satellite remote sensing technology to obtain images of land use within the monitored area over a certain period. Combined with GIS technology, the monitored land that has undergone changes is partitioned and numbered according to certain rules.

[0066] Other relevant information may include, but is not limited to, the following:

[0067] Monitoring reports: These include annual, quarterly, or monthly reports on natural resource monitoring, which may contain monitoring results, trend analyses, problems, and recommendations for various natural resources.

[0068] GIS data: Geographic Information System (GIS) data is geospatial information, which may include topographic maps, land use data, remote sensing images, etc., and is used to analyze and monitor changes and utilization of natural resources;

[0069] Policy documents: Government documents, regulations, plans, etc., concerning the management, protection and utilization of natural resources, which may include requirements, guiding principles and policy measures for natural resource monitoring;

[0070] Expert opinions: Experts' interpretations, evaluations, and recommendations on natural resource monitoring results may exist in the form of reports, papers, conference minutes, etc.

[0071] Project materials: Documents such as project applications, project plans, implementation schemes, and results reports for natural resource monitoring projects, which can be used to understand the specific objectives, methods, and results of the monitoring;

[0072] Scientific research papers: Scientific research papers on natural resource monitoring technologies, methods, and applications can provide the latest understanding and discussion of monitoring technologies and methods;

[0073] Data standards: Standards and specifications for the collection, processing, storage, and sharing of natural resource monitoring data to ensure data quality and comparability;

[0074] Training materials: Training materials, courseware, videos, etc. on natural resource monitoring technologies and methods;

[0075] The collected data underwent preprocessing such as cleaning, labeling, and augmentation to standardize the data and improve the efficiency and accuracy of model training. For routine map feature review rules, the data was organized into TXT format according to land use type and individual layer type. Other data and information were organized into TXT format according to attributes such as year, administrative region, and land use type. The TXT files were then preprocessed with text segmentation, part-of-speech tagging, and the addition of serial numbers. For content that was difficult to identify, it was organized into the format {"content":"","summary":""} and saved as a JSON file.

[0076] In the field of natural resource monitoring, the more difficult aspects to identify include:

[0077] Technical terms: These are specialized terms and jargon related to fields such as natural resource monitoring and land use, which may be difficult for non-professionals to understand.

[0078] Vague descriptions: The descriptions of certain concepts or phenomena in the text are not clear or specific enough, making it difficult to accurately determine their meaning;

[0079] Special symbols and formatting: The text contains a large number of special symbols, charts, or formatting, making it difficult to extract information;

[0080] Data preprocessing creates a dataset so that the model can accurately identify user problems and needs.

[0081] The effects of the above technical solutions are as follows: Data cleaning effectively removes duplicate, erroneous, or invalid data, improving the purity and accuracy of the dataset; it avoids the influence of noisy data on the model during training, improving the model's prediction accuracy and stability; preprocessing methods such as text segmentation and part-of-speech tagging accelerate data processing and reduce time costs; organizing data by adding sequence numbers facilitates subsequent data analysis and utilization; a unified preprocessing process integrates data from different sources and formats into a unified dataset, achieving data standardization and uniformity; it helps eliminate inconsistencies between data, improves comparability, and facilitates subsequent data analysis and model training; the preprocessed dataset not only improves data quality but also makes the data more suitable for model input requirements. This helps the model better learn and understand data features, and data expansion can increase the model's generalization ability, enabling it to cope with more complex real-world situations. For content that is difficult to identify, organizing it into a specific format and saving it as a JSON file makes this information easier to retrieve and utilize. This helps users or researchers quickly locate the information they need, improving information utilization efficiency.

[0082] In summary, this technical solution preprocesses relevant data and information on natural resource monitoring, forming a high-quality, standardized, and unified dataset. This provides strong support for model training and subsequent data analysis, improving the efficiency and accuracy of the entire natural resource monitoring work.

[0083] In some embodiments, the step of constructing a local knowledge base for routine monitoring of natural resources using the dataset and a large language model, and converting the text in the dataset into text vectors, includes:

[0084] The preprocessed txt dataset is input into a large language model to construct a local knowledge base for routine monitoring of natural resources.

[0085] The text in the txt dataset is segmented, and the segmented text is converted into text vectors.

[0086] The working principle and effect of the above technical solution are as follows: The preprocessed txt dataset is input into the large language model; the large language model is a deep learning model trained on a large-scale corpus, capable of understanding and generating natural language text; in this process, the model analyzes the text content in the dataset, identifying semantic information, entity relationships, etc., providing a foundation for subsequent knowledge base construction. Next, the large language model segments the text in the txt dataset; text segmentation is the process of dividing long texts into shorter text fragments or sentences, helping the model to better process and understand text content; through segmentation, the model can perform more refined analysis and feature extraction for each fragment or sentence; then, the model converts the segmented text into text vectors; text vectors are the process of converting text information into numerical vectors, thus converting text data into a format that computers can process; the large language model typically uses pre-trained word embedding techniques, such as Word2Vec and BERT, to convert each word or phrase in the text into a fixed-dimensional vector representation; these vectors capture the semantic relationships between words, enabling the model to perform similarity comparisons, clustering, and other operations based on the vectors.

[0087] Finally, by utilizing the analysis and vector representation of text using a large language model, a local knowledge base for routine monitoring of natural resources is constructed. The local knowledge base is a system for storing and managing domain-related knowledge. It contains information such as entities, relationships, and events extracted from the dataset and organized in a structured form. The large language model analyzes the text content, extracts key information related to natural resource monitoring, and stores it in the knowledge base.

[0088] Based on the above working principle, this embodiment utilizes the capabilities of a large language model to transform the preprocessed dataset into a structured local knowledge base, providing effective information support for routine monitoring of natural resources; it helps improve the efficiency and accuracy of monitoring work and promotes the scientific and intelligent management of natural resources.

[0089] In some embodiments, the text in the txt dataset is segmented, including:

[0090] Define the specific objectives of routine monitoring of natural resources; for example, the monitoring objectives include post-approval supervision of construction land, urban land space elements, idle land, "three old" renovations, temporary land use, arable land resources, facility agriculture land, land law enforcement, open-pit mining, ecological restoration, land reclamation, forest resources, wetland resources, and the scope and changes of surface water.

[0091] Identify the content and structure of the dataset; identify key information in the dataset, such as geographic features, review requirements, monitoring indicators, etc.

[0092] Based on the monitoring objectives, a segmentation strategy is determined and a segmentation model is established. The segmentation strategy includes the dimensions and granularity of the segmentation. For example, segmentation can be carried out according to different dimensions such as land features, review requirements, or monitoring indicators. Different monitoring objectives may require different granularities of segmentation. For example, monitoring of illegal construction land use may require finer-grained segmentation in order to accurately track and promptly detect minor changes in land use nature, area, construction progress, etc.

[0093] Using a labeled dataset, a segmentation model is trained and tested to obtain test results; based on these test results, the segmentation model is optimized, specifically including:

[0094] Classify the labeled dataset; obtain the error rate under different classifications;

[0095] The error rate is:

[0096]

[0097]

[0098] Among them, E i Z represents the segmentation error rate for the i-th category. ij The total length of the j-th text in the i-th category; L ij W represents the total length of the erroneously segmented text in the i-th and j-th texts. ij The weight of the j-th text in the i-th category; m is the total number of texts in the i-th category;

[0099] Analyze the classifications with error rates greater than the error rate threshold, adjust the segmentation model based on the analysis results, and perform iterative optimization.

[0100] Among them, the error rate threshold is:

[0101] E y =(1 - k)×E0

[0102] Among them, E0 is a preset threshold, k is a coefficient, 0 < k ≤ 0.5; it is determined by the importance of the monitoring task and the severity score caused by the error; for example: the task importance score is from 1 to 5 points, the severity score caused by the error is from 1 to 5 points, and the final score is the weighted average of the task importance score and the severity score caused by the error;

[0103] k = 0.5*(P / Pmax);

[0104] Among them, P is the final score of this target monitoring task, and Pmax is the maximum value of the scores in all target monitoring tasks;

[0105] For the categories with a high error rate, analyze specific error cases in depth; check whether the model frequently makes mistakes on specific types of texts, such as specific language structures, technical terms, data formats, etc.;

[0106] Identify the error patterns, such as incorrect segmentation positions, omission of key information, or classification errors;

[0107] Collect specific feedback from the error analysis, such as which types of text segmentations are inaccurate, which information is incorrectly omitted or included;

[0108] According to the error feedback, update the training dataset; for example: add more challenging samples, or modify the existing samples to better reflect the characteristics of the actual data.

[0109] According to the error analysis, adjust the segmentation strategy; for example, if it is found that the model performs poorly when processing long sentences, a more complex sentence segmentation strategy can be considered;

[0110] If some key information is omitted, the feature extraction method may need to be adjusted to ensure that this information is correctly recognized by the model; if the error analysis shows that the model lacks knowledge in certain fields, an external knowledge base can be considered or a knowledge enhancement method can be used to improve the performance of the model.

[0111] The working principle of the above technical solution is as follows: First, based on the specific objectives of routine natural resource monitoring (such as post-approval supervision of construction land, urban land space elements, idle land, "three old" renovations, temporary land use, arable land resources, facility agricultural land, land law enforcement, open-pit mining, ecological restoration, land reclamation, forest resources, wetland resources, surface water scope and changes, etc.), the content and structure of the dataset are analyzed to identify the key information that needs to be monitored. Based on the monitoring objectives and dataset characteristics, text segmentation strategies are determined, including the segmentation dimensions (such as land cover features, review requirements, or monitoring indicators) and granularity. Then, a segmentation model is built based on these strategies. The segmentation model is trained using a labeled dataset, and its performance is evaluated using a test set. An error rate calculation method is introduced here to quantify the degree of error in text segmentation under different classifications. Based on the test results, a deeper analysis is conducted on classifications with high error rates to identify error patterns and causes. Based on error feedback, the training dataset is updated and the segmentation strategy is adjusted. This may involve adding challenging samples, modifying existing samples, adjusting feature extraction methods, or introducing external knowledge bases. By continuously iterating and optimizing the model, the error rate is gradually reduced, and the accuracy and efficiency of text segmentation are improved.

[0112] The working principle and effects of the above technical solution are as follows: By deeply analyzing the characteristics of monitoring targets and datasets, and continuously iterating and optimizing the model, the accuracy of text segmentation can be significantly improved, ensuring that key information is correctly extracted and preserved; accurate text segmentation helps to build a high-quality local knowledge base for routine natural resource monitoring, providing a reliable foundation for subsequent knowledge extraction, reasoning, and decision support; by introducing challenging samples and external knowledge bases, the generalization ability of the model can be enhanced, enabling it to better handle text data of different types and complexities; efficient text segmentation methods can reduce data processing time and costs, and improve the efficiency and real-time performance of routine natural resource monitoring.

[0113] In conclusion, selecting an appropriate text segmentation method is of great significance for building a local knowledge base for routine monitoring of natural resources, and can effectively improve the quality of the knowledge base and the monitoring efficiency.

[0114] In some embodiments, the large language model parameters include: a knowledge base relevance threshold, the number of knowledge base content entries obtained, and whether context association is enabled. Adjusting the model parameters can improve the accuracy and completeness of the answer; the knowledge base relevance score threshold ranges from 0 to 1100, with lower scores indicating higher matching accuracy; increasing the number of knowledge base content entries or the number of context association words leads to more scientific and complete answers; an initial relevance threshold is set based on historical data or experience; this initial relevance threshold can be adjusted according to the size and quality of the knowledge base; the number of returned information entries is set according to the complexity and detail of the user query; for simple queries, only a few key pieces of information need to be returned; for complex queries, more detailed information needs to be returned; the relevance threshold is adjusted based on the number of matching information entries and the number of information entries to be returned; whether context association needs to be enabled is determined based on the application scenario and user needs; for example, if user queries typically involve consecutive questions or require a deeper understanding of the context, enabling context association may help improve the user experience; context association can be implemented by introducing session states into the model or utilizing the model's memory capabilities.

[0115] The working principle of the above technical solution is as follows: Based on historical data or experience, an initial knowledge base relevance threshold is set; this threshold determines the minimum matching degree for extracting information from the knowledge base; since the lower the score, the higher the matching degree, the process of adjusting the threshold is essentially a balance between the accuracy and quantity of information. Based on actual operation and user feedback, the threshold is continuously adjusted to find the optimal matching point; for example, if the returned information is too broad or inaccurate, the threshold can be appropriately increased; conversely, if the returned information is too narrow or insufficient, the threshold can be appropriately decreased.

[0116] The initial number of returned information entries is set based on the complexity and detail of the user's query. For simple queries, the system may only need to return a few key pieces of information; while for complex queries, more detailed information needs to be returned to meet the user's needs. During actual operation, the number of returned information entries is continuously optimized by observing user behavior and feedback. If users frequently need to query or supplement information, it indicates that the current number of returned entries may be insufficient; conversely, if users indicate that the information is too much or repetitive, the number of returned entries needs to be reduced. By adjusting the knowledge base relevance threshold and the number of knowledge base content entries obtained, the system can more accurately extract information related to the user's query from the knowledge base, thereby improving the accuracy of the answer.

[0117] The decision to enable contextual association should be based on the application scenario and user needs. If user queries typically involve consecutive questions or require a deep understanding of the context, enabling this feature can improve user experience and the accuracy of the answers. Contextual association is achieved by introducing session state into the model or leveraging the model's memory capabilities; when answering user questions, the model considers previous conversation content, thus providing more coherent and accurate responses; through reasonable parameter settings and feature optimization, the system can process user queries more efficiently, reduce unnecessary computational and storage overhead, and improve system response speed and overall performance.

[0118] In summary, by adjusting the parameters and functional settings of the large language model, the routine auxiliary monitoring method for natural resources based on the large language model can provide richer and more complete information while ensuring accuracy, thereby optimizing user experience and system efficiency.

[0119] In some embodiments, fine-tuning the parameters of the large language model includes:

[0120] Replace the training, validation, and test files in the P-Tuning framework directory with the path to the JSON dataset;

[0121] Set the maximum length of the input and output text sequences in the JSON file.

[0122] The working principle of the above technical solution is as follows: P-Tuning is a technique for fine-tuning a pre-trained language model with a small number of parameters. Model fine-tuning is achieved by replacing the training, validation, and testing files in the P-Tuning directory with the path to the JSON dataset processed in step two, changing `prompt_column` and `response_column` to the keys corresponding to the input and output text in the JSON file, and setting the maximum length of the input and output sequences.

[0123] The working principle of the above technical solution is as follows: P-Tuning is a lightweight fine-tuning method that focuses on optimizing the prompt part in the pre-trained language model, rather than making large-scale parameter adjustments to the entire model. The core idea of ​​this method is to insert some special prompt tokens into the input part of the model and only fine-tune the parameters of these tokens, thereby achieving the adjustment of the model behavior.

[0124] In this implementation, firstly, the training, validation, and test files in the P-Tuning framework directory are replaced with the path to the processed JSON dataset. This is because P-Tuning requires a dataset in a specific format for fine-tuning training, and the JSON dataset provides key-value pairs of input text and corresponding output text, which conforms to the data format required by P-Tuning.

[0125] In the input section of the model, insert appropriate prompts according to the requirements of P-Tuning;

[0126] During fine-tuning, only the parameters of the cue markers are trained, while other parameters of the pre-trained model remain unchanged. This fine-tuning method retains most of the knowledge of the pre-trained model and can adjust the model's behavior according to specific tasks, achieving lightweight customization of the model. Setting the maximum length of the input and output text sequences in the JSON file is to limit the processing range of the model and avoid excessively long inputs or outputs that could lead to wasted computing resources or performance degradation.

[0127] The effects of the above technical solution are as follows: By fine-tuning the parameters of the cue markers, the model can better adapt to the needs of specific tasks, improving the accuracy of the model in routine auxiliary monitoring of natural resources. Since P-Tuning only fine-tunes a small number of parameters, it requires fewer computational resources and trains faster than full model fine-tuning, facilitating rapid deployment and optimization of the model in practical applications. Because most model parameters remain unchanged, the fine-tuned model retains the versatility and generalization ability of the pre-trained model, demonstrating good performance on similar tasks. The P-Tuning framework provides a flexible space for parameter adjustment and optimization, allowing for further adjustments to the cue marker settings or the introduction of other optimization strategies to further improve model performance based on specific needs.

[0128] In summary, using P-Tuning for fine-tuning large language model parameters enables lightweight model customization, improves the model's adaptability to routine auxiliary monitoring tasks of natural resources, and optimizes the use of computing resources, providing a more efficient and flexible solution for practical applications.

[0129] In some embodiments, the step of responding to a user-selected knowledge base and an input question by invoking the large language model to obtain the result of the input question and returning it to the dialogue interface includes:

[0130] Obtain the user's chosen knowledge base and input questions;

[0131] Transform the input question into an input vector;

[0132] The input vector is matched with the text vector to obtain the relevant text;

[0133] Based on the relevant text, an answer is generated using a large language model.

[0134] The working principle and effect of the above technical solution are as follows: First, the user-selected knowledge base and the input query question are captured; the user-selected knowledge base determines the search scope, while the query question is the specific content the user hopes the system will answer; the user-input query question is transformed into an input vector; for example, text embedding technology is used to convert text information into a numerical vector that can be processed by a computer. The input vector is matched with pre-constructed text vectors (i.e., vector representations of text in the knowledge base); this is achieved by calculating the similarity between vectors, for example, using metrics such as cosine similarity. Through matching, text related to the user's query question is found, i.e., relevant information in the knowledge base.

[0135] Once the relevant text information is available, a large language model is used to generate the answer. This large language model has been pre-trained and possesses rich language knowledge and reasoning capabilities. The relevant text is used as input to the model, and based on the model's internal representation and reasoning mechanism, an answer to the query is generated. Finally, the generated answer is returned to the dialogue interface and displayed to the user. In this way, the user can see the system's solution to their query, thus completing a full interaction process.

[0136] Through this process, the system utilizes a large language model and a constructed knowledge base to understand and answer user queries, enabling intelligent services for routine auxiliary monitoring of natural resources. This improves response speed and accuracy, enhances user experience, and allows users to more easily obtain the information they need.

[0137] In some embodiments, the process of evaluating system performance through comprehensive analysis of user feedback, system logs, and test reports, and improving and optimizing the system based on the evaluation results, includes:

[0138] Obtain user feedback through the user feedback interface;

[0139] The system's performance is evaluated using user feedback, system logs, and test reports; the evaluation results are then obtained.

[0140] The system was improved and optimized based on the evaluation results.

[0141] The working principle and effects of the above technical solution are as follows: Based on the Gradio framework, an intuitive and easy-to-use user feedback interface is designed. This interface allows users to provide feedback on system performance, interface design, and functional completeness through simple operations after using the system. User feedback can be text descriptions, ratings, or selection of preset feedback options. User feedback data is transmitted to the system backend in real time through a preset interface for subsequent analysis. A comprehensive analysis is then performed by combining user feedback, system logs, and test reports. The system logs record the system's operational status in detail, including response time, the number of requests processed, and errors encountered. The test report evaluates various performance indicators of the system through a series of test cases. Using this data, multiple evaluation metrics (such as response time, processing capacity, accuracy, and recall) are employed to quantify the system's performance. These metrics comprehensively reflect the system's effectiveness, helping developers identify system bottlenecks and potential problems. Based on the above analysis, a detailed evaluation report is generated. The report includes the values ​​of each metric, provides a comprehensive evaluation of the system's performance, and points out existing problems and directions for improvement. Based on the evaluation results report, developers make targeted improvements and optimizations to the system, including optimizing algorithms, adjusting system parameters, fixing known bugs, and adding new features. After the improvements are made, performance testing and user feedback are collected again, forming a closed-loop iterative process that continuously drives the improvement of system performance. Through the above steps, user feedback is continuously collected, performance is monitored, and improvements and optimizations are made according to the actual situation, thereby continuously improving user experience and system efficiency.

[0142] This application provides a routine auxiliary monitoring system for natural resources based on a large language model, the system comprising:

[0143] The model deployment module is used to configure and deploy models locally via computer / terminal environment configuration. Before installing and deploying ChatGLM2-6B, LangChain, and P-Tuning, the computer environment must be configured first. Check that the graphics card driver supports the highest CUDA version, download and install Python 3.10, the appropriate CUDA version, PyTorch version, and Transformers version. Then, by downloading the installation packages and replacing and modifying them, the local deployment of the model is completed and connected to the knowledge base.

[0144] The dataset acquisition module is used to acquire natural resource monitoring-related data and information, and to preprocess the data and information to obtain a dataset; the dataset includes a txt dataset and a json dataset;

[0145] The knowledge base building module is used to construct a local knowledge base for routine monitoring of natural resources using the dataset and a large language model; and to convert the text in the dataset into text vectors.

[0146] The parameter setting module is used to set and adjust the parameters of the large language model;

[0147] The parameter fine-tuning module is used to fine-tune the parameters of the large language model;

[0148] The knowledge base question answering module is used to respond to the user's selected knowledge base and input question, call the large language model to obtain the result of the input question, and return it to the dialogue interface.

[0149] The model optimization module is used to comprehensively evaluate the system's performance by analyzing user feedback, system logs, and test reports, and to improve and optimize the system based on the evaluation results.

[0150] The dataset acquisition module includes:

[0151] The data acquisition unit is used to acquire data and information related to natural resource monitoring, including routine monitoring patch data, review rule documents, and other relevant information.

[0152] The preprocessing unit is used to preprocess the relevant data and information, including data cleaning, text segmentation, annotation, and expansion. For other data and information, it is organized into txt format according to attributes such as year, administrative region, and land use type, and then preprocessed by performing text segmentation, part-of-speech tagging, and adding serial numbers. For content that is difficult to identify, it is organized into the format {"content":"","summary":""} and saved as a JSON file.

[0153] A dataset forming unit is used to form a dataset from the preprocessed data.

[0154] In some embodiments, the knowledge base building module includes:

[0155] The knowledge base construction unit inputs the preprocessed txt dataset into the large language model to build a local knowledge base for routine monitoring of natural resources.

[0156] The vector transformation unit is used to segment the text in the txt dataset and convert the segmented text into text vectors.

[0157] In some embodiments, the text in the txt dataset is segmented, including:

[0158] Define the specific objectives of regular natural resource monitoring; for example, the monitoring objectives are post-approval supervision of construction land, urban land space elements, idle land, "Three Olds" transformation, temporary land use, cultivated land resources, facility agricultural land, land law enforcement, surface mining, ecological restoration, land reclamation, forest resources, wetland resources, surface water scope and changes;

[0159] Identify the content and structure of the dataset; identify the key information in the dataset, such as monitoring objectives, review requirements, monitoring indicators, etc.;

[0160] According to the monitoring objectives, determine the segmentation strategy and establish a segmentation model; the segmentation strategy includes the dimensions and granularity of segmentation; for example, segmentation can be performed according to different dimensions such as ground feature characteristics, review requirements, or monitoring indicators; different monitoring objectives may require different segmentation granularities. For example, monitoring of construction land violations may require finer granularity segmentation to accurately track and timely detect minor changes in land use nature, area, construction progress, etc.;

[0161] Train and test the segmentation model with the labeled dataset to obtain test results; optimize the segmentation model according to the test results, specifically including:

[0162] Classify the labeled dataset; obtain the error rates under different classifications;

[0163] The error rate is:

[0164]

[0165] where, E i is the segmentation error rate under the i-th classification, Z ij is the total length of the j-th text under the i-th classification; L ij is the total length of the segmented error texts in the i-th and j-th texts; W ij is the weight of the j-th text under the i-th classification; m is the total number of texts under the i-th classification;

[0166] Analyze the classifications with error rates greater than the error rate threshold, and according to the analysis results, adjust the segmentation model and perform iterative optimization; where, the error rate threshold is:

[0167] E y =(1 - k)×E0

[0168] where, E0 is the preset threshold, k is a coefficient, 0 < k ≤ 0.5; determined by the importance of the monitoring task and the severity score of the error; for example: the task importance score is 1 - 5 points, the severity score of the error is 1 - 5 points, and the final score is the weighted average of the task importance score and the severity score of the error;

[0169] k = 0.5 * (P / Pmax);

[0170] Where P is the final score of the target monitoring task, and Pmax is the maximum score among all target monitoring tasks.

[0171] For categories with high error rates, conduct in-depth analysis of specific error cases; check whether the model frequently makes errors on specific types of text, such as specific language structures, technical terms, data formats, etc.

[0172] Identify patterns of errors, such as incorrect segmentation, missing key information, or incorrect classification.

[0173] Collect specific feedback from error analysis, such as which types of text segmentation are inaccurate, and which information is incorrectly omitted or included;

[0174] Update the training dataset based on error feedback; for example, by adding more challenging samples or modifying existing samples to better reflect the characteristics of real-world data.

[0175] Based on error analysis, adjust the segmentation strategy; for example, if it is found that the model does not perform well when processing long sentences, a more complex sentence segmentation strategy can be introduced.

[0176] If some key information is missed, the feature extraction method may need to be adjusted to ensure that the model correctly identifies this information. If error analysis shows that the model lacks knowledge in certain domains, it may be necessary to consider introducing an external knowledge base or using knowledge augmentation methods to improve the model's performance.

[0177] In some embodiments, the large language model parameters include: a knowledge base relevance threshold, the number of knowledge base content entries obtained, and whether context association is enabled. Adjusting the model parameters can improve the accuracy and completeness of the answer; the knowledge base relevance score threshold ranges from 0 to 1100, with lower scores indicating higher matching accuracy; increasing the number of knowledge base content entries or the number of context association words leads to more scientific and complete answers; an initial relevance threshold is set based on historical data or experience; this initial relevance threshold can be adjusted according to the size and quality of the knowledge base; the number of returned information entries is set according to the complexity and detail of the user query; for simple queries, only a few key pieces of information need to be returned; for complex queries, more detailed information needs to be returned; the relevance threshold is adjusted based on the number of matching information entries and the number of information entries to be returned; whether context association needs to be enabled is determined based on the application scenario and user needs; for example, if user queries typically involve consecutive questions or require a deeper understanding of the context, enabling context association may help improve the user experience; context association can be implemented by introducing session states into the model or utilizing the model's memory capabilities.

[0178] In some embodiments, the parameter fine-tuning module includes:

[0179] The path replacement unit is used to replace the training, validation, and test files in the P-Tuning framework directory with the paths to the JSON dataset;

[0180] The setting unit is used to set the maximum length of the input and output text sequences in the JSON file.

[0181] In some embodiments, the knowledge base question-answering module includes:

[0182] The user selects an acquisition unit to obtain the knowledge base selected by the user and the input question;

[0183] The input transformation unit is used to transform the input question into an input vector;

[0184] A matching unit is used to match the input vector with the text vector to obtain relevant text;

[0185] The return unit is used to generate an answer based on the relevant text and a large language model.

[0186] In some embodiments, the model optimization module includes:

[0187] The feedback acquisition unit is used to obtain user feedback through the user feedback interface;

[0188] The evaluation unit is used to evaluate the system's performance based on user feedback, system logs, and test reports; and to obtain evaluation results.

[0189] The optimization unit is used to improve and optimize the system based on the evaluation results.

[0190] The working principle and effect of the above technical solution are the same as those of the method described in the embodiments of this application, and will not be repeated here.

[0191] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described in this embodiment, or to implement the functions of the system described in the embodiments of this application.

[0192] This application also provides a computer-readable storage medium storing a computer program that, when executed by at least one processor, implements the steps of any of the methods described in this application, or implements the functions of the system described in this application.

[0193] In this application, a readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. The program product can take the form of any combination of one or more readable media. A readable medium can be a readable signal medium or a readable storage medium. A readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0194] Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium capable of sending, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, or any suitable combination thereof. Program code for performing operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar programming languages. The program code may be executed entirely on a user computing device, partially on an associated device, as a standalone software package, partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to user computing devices via any type of network, including local area networks (LANs) or wide area networks (WANs), or they can be connected to external computing devices (e.g., via the Internet using an Internet service provider).

[0195] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the invention without departing from the principles and spirit of the invention, and all such changes should fall within the protection scope of the claims of the present invention.

Claims

1. A method for routine auxiliary monitoring of natural resources based on a large language model, characterized in that, The method includes: Configure the model and deploy it locally by configuring the terminal environment; Acquire relevant data and information on natural resource monitoring, and preprocess the relevant data and information to obtain a dataset; the dataset includes a txt dataset and a json dataset; Using the dataset, a local knowledge base for routine monitoring of natural resources is constructed using a large language model; and the text in the dataset is converted into text vectors; the process of constructing a local knowledge base for routine monitoring of natural resources using the dataset and a large language model, and converting the text in the dataset into text vectors, includes: inputting the preprocessed txt dataset into the large language model to construct the local knowledge base for routine monitoring of natural resources; segmenting the text in the txt dataset, and converting the segmented text into text vectors; The text segmentation process in the txt dataset specifically includes: clarifying the specific objectives of routine natural resource monitoring; identifying the content and structure of the dataset; identifying key information in the dataset; determining a segmentation strategy and establishing a segmentation model based on the specific monitoring objectives, wherein the segmentation strategy includes the segmentation dimension and granularity; training and testing the segmentation model using a labeled dataset to obtain test results; wherein, when optimizing the segmentation model based on the test results, an error rate calculation method is introduced to quantify the degree of error in text segmentation under different categories; based on the test results, in-depth analysis is conducted on categories with high error rates to identify error patterns and causes, and the training set is updated and the segmentation strategy is adjusted based on error feedback; Set and adjust the parameters of the large language model; Fine-tuning of the parameters of the large language model; In response to the user's selected knowledge base and input question, the large language model is invoked to obtain the result of the input question and returned to the dialog interface; By comprehensively analyzing user feedback, system logs, and test reports, the system's performance is fully evaluated, and improvements and optimizations are made based on the evaluation results.

2. The monitoring method according to claim 1, characterized in that, The process of acquiring relevant data and information on natural resource monitoring, and preprocessing the data and information to obtain a dataset, includes: Acquire relevant data and information on natural resource monitoring, including routine monitoring patch data, review rule documents, and other relevant information; The relevant data and information are preprocessed, including data cleaning, text segmentation, annotation, and augmentation. The preprocessed data is then used to form a dataset.

3. The monitoring method according to claim 1, characterized in that, The parameters of the large language model include: knowledge base relevance threshold, number of knowledge base content entries obtained, and whether context association is enabled.

4. The monitoring method according to claim 1, characterized in that, The fine-tuning of the parameters of the large language model includes: Replace the training, validation, and test files in the P-Tuning framework directory with the path to the JSON dataset; Set the maximum length of the input and output text sequences in the JSON file.

5. The monitoring method according to claim 1, characterized in that, The process of responding to the user's selected knowledge base and input question, invoking the large language model to obtain the result of the input question, and returning it to the dialogue interface includes: obtaining the user's selected knowledge base and input question; converting the input question into an input vector; matching the input vector with the text vector to obtain relevant text; and generating an answer based on the large language model according to the relevant text.

6. The monitoring method according to claim 1, characterized in that, The process of comprehensively analyzing user feedback, system logs, and test reports to evaluate system performance and improve and optimize the system based on the evaluation results includes: obtaining user feedback through a user feedback interface; evaluating system performance based on user feedback, system logs, and test reports; obtaining evaluation results; and improving and optimizing the system based on the evaluation results.

7. A routine auxiliary monitoring system for natural resources based on a large language model, employing the routine auxiliary monitoring method for natural resources based on a large language model as described in any one of claims 1-6, characterized in that, The system includes: The model deployment module is used to configure models and deploy them locally through terminal environment configuration. The dataset acquisition module is used to acquire natural resource monitoring-related data and information, and to preprocess the data and information to obtain a dataset; the dataset includes a txt dataset and a json dataset; The knowledge base building module is used to construct a local knowledge base for routine monitoring of natural resources using the dataset and a large language model; and to convert the text in the dataset into text vectors. The parameter setting module is used to set and adjust the parameters of the large language model; The parameter fine-tuning module is used to fine-tune the parameters of the large language model; The knowledge base question answering module is used to invoke the large language model in response to the user's selected knowledge base and input question. Obtain the result of the input question and return it to the dialog interface; The model optimization module is used to comprehensively evaluate the system's performance by analyzing user feedback, system logs, and test reports, and to improve and optimize the system based on the evaluation results.

8. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of any one of the methods of claims 1-6, or implements the function of the system of claim 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by at least one processor, implements the steps of any one of the methods of claims 1-6, or implements the function of the system of claim 7.

Citation Information

Patent Citations

  • Knowledge base construction method and question and answer dialogue method and system based on generative large language model

    CN117056471A

  • Natural resource industry knowledge base construction method and system based on large language model

    CN117172319A

  • Medical question answering system based on large language model

    CN117851558A