River and lake water environment early warning method and system based on semantic labeling

Through the semantic label construction method, corpus data is used to construct mapping relationships at the early warning level of river and lake water environment, which solves the problem of insufficient time particle size and spatial distribution of water quality detection data, realizes low-cost and high-efficiency data annotation and model training, and improves the prediction performance of river and lake water environment warning models.

CN119025926BActive Publication Date: 2025-03-11GUANGDONG LONGQUAN TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411513830.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-03-11
Estimated Expiration
2044-10-29

AI Technical Summary

Technical Problem

In the early warning of river and lake water environment, the existing technology is limited by the rough time particle size and sparse spatial distribution of water quality detection data, resulting in limited model performance, and the cost of obtaining label data is high and the efficiency is low.

Method used

The semantic label construction method is adopted to collect and preprocess the corpus data describing river and lake problems, and use statement embedding models and semantic theme modeling technology to construct a mapping relationship from corpus data to river and lake water environment early warning level, generate semantic label sample sets, reduce data annotation costs and improve data acquisition efficiency.

Benefits of technology

It improves data acquisition efficiency, reduces the cost of data sample annotation, solves the shortcomings of water quality detection data in time particle size and spatial distribution, improves the quantity and quality of model training data, and improves the prediction performance of river and lake water environment early warning model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025926B_ABST
    Figure CN119025926B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing, and specifically to a semantic label construction method, a river and lake water environment early warning method and system based on semantic label construction. The early warning method first constructs semantic labels describing river and lake problems based on corpus-type original data describing river and lake problems, and obtains semantic label sample set data; collects numerical original data through equipment and processes it to obtain numerical feature sample set data; aligns and fuses the semantic label sample set data with the numerical feature sample set data to obtain a model training data sample set; uses the model training data sample set to train a river and lake water environment early warning model; and uses the trained river and lake water environment early warning model to perform early warning analysis on the river and lake water environment. The present invention uses corpus describing water quality conditions to construct semantic labels, which solves the problem that the training data and model performance are limited by the coarse time granularity and sparse spatial distribution of water quality detection data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and specifically to a semantic tag construction method, and a river and lake water environment early warning method and system based on semantic tag construction. Background Art

[0002] In the current water conservancy vertical field, the use of machine learning and deep learning technologies for related data processing has become relatively common, but there are still only a few machine learning models that have performed well in actual business. In the way to improve model performance, the current common practice is still to build training data sets based on a large amount of labeled data, and the label data (labels) in the training data are mainly labeled manually. Manually labeling samples is not only time-consuming and labor-intensive, but also usually costly, which has imposed certain restrictions on the use of new technologies in fields such as public welfare services. Therefore, finding a low-cost and efficient method for building training data has become an urgent problem to be solved.

[0003] In recent years, natural language processing (NLP) technology has achieved great success in self-supervised learning, paving the way for the leap from pre-trained models to large language models. Several core technologies developed in this process have brought new inspiration for building training data sets and have shown great potential in terms of low cost and high efficiency. In particular, the migration of pre-trained language models to areas where resources (computing resources, talent resources, etc.) are relatively scarce has not only improved the ability to utilize data, but also ultimately improved the practicality of the model, thereby achieving quality and efficiency improvements at the business level.

[0004] Specifically for the river chief system water management business, the current machine learning model is mainly based on the supervised learning paradigm to train the model. Existing technologies improve the quantity and quality of training data by integrating multi-source and multi-dimensional data from the perspective of feature data in training data. As the business develops, the label data formed by marking water quality data in the training data has become a bottleneck for model performance.

[0005] For water quality data, based on the coverage rate of water quality data collected in each cycle (usually set to one month) (taking the city-level river sections as the object, counting "number of sampled river sections / total number of river sections"), the proportions of the two water quality collection methods are: automatic collection equipment (198 / 1700) is about 12% and manual fixed-point collection (500 / 1700) is about 29%, that is, the proportion of river sections where water quality data can be collected is about 41%. Among them, the sampling data collected manually at fixed points has a large lag, especially for evaluating the water quality of river sections. In theory, according to the most naive idea, the measurement value near the end of the month should be more useful for predicting the trend of the next month, but in fact, the practice is to comprehensively calculate multiple sampling values ​​in a cycle to obtain a comprehensive value to characterize the water quality of the river section in the current cycle, which brings greater challenges to data modeling. Therefore, when using these water quality data as label data for model training data, it must be recognized that these water quality data themselves have large noise. From the perspective of machine learning, the errors caused by these noise signals are irreducible errors. In particular, after aligning the water quality data (monthly granularity) to the river patrol problem data (daily granularity), although certain filtering rules were formulated and implemented, the alignment operation based on upsampling (converting from low-frequency data to high-frequency data) inevitably increased the noise information in the label data.

[0006] In practical applications, the training of supervised machine learning models for early warning of water environment risks in rivers and lakes requires a large number of training sample data sets; the method of obtaining water quality label data based on water quality testing has insufficient cost and operation, resulting in the actual performance of the model being restricted by the label data. The intuitive improvement method is to increase the automatic detection equipment and increase the investment in manual detection, that is, to apply for more resource investment; if a large number of small and micro water bodies are also included in the early warning supervision, it is difficult to estimate how much resources will be needed to make it feasible; therefore, this method is neither sufficiently scalable nor innovative.

[0007] As mentioned earlier, obtaining labeled data is usually costly, and this problem needs to be solved or alleviated at the technical level. Summary of the invention

[0008] In order to solve the problems existing in the prior art, the present invention proposes a semantic label construction method, a river and lake water environment early warning method and system based on semantic label construction, and uses a corpus describing water quality conditions to construct semantic labels, thereby improving the efficiency of data collection and reducing the cost of data sample annotation, and innovatively solving the problem that current training data and model performance are limited by the coarse time granularity and sparse spatial distribution of water quality detection data.

[0009] In an embodiment of the present invention, a semantic tag construction method includes the following steps:

[0010] Collect corpus-type raw data describing river and lake issues;

[0011] Preprocess the corpus-type raw data to obtain a corpus sample set, use the sentence embedding model to vectorize the corpus samples in the corpus sample set, generate sentence vectors, and obtain a vectorized corpus semantic vector set;

[0012] Using semantic topic modeling technology, we selected typical corpus-type raw data describing river and lake problems, constructed a mapping relationship from river and lake problem description corpus to river and lake water environment warning level, and embedded the corresponding river section water quality risk level label into the corresponding corpus-type raw data to obtain a typical semantic label sample, namely {problem description sentence: risk level label};

[0013] Based on typical semantic label samples, semantic vector similarity retrieval is adopted, and the sentence embedding model is used to encode the "problem description sentence" of the typical semantic label sample to obtain the query vector (query). The query vector is used to perform similarity search on the corpus vector set, and the searched results are annotated with the labels of the typical semantic label samples. The vectorized corpus samples in the corpus semantic vector set are labeled to obtain the semantic label sample set data.

[0014] Preferably, the step of generating a sentence vector includes:

[0015] Establish a sentence embedding model and set up a dual-tower architecture for the sentence embedding model;

[0016] The corpus length of the corpus-type original data describing river and lake problems is limited, and the corpus-type original data with a length less than the preset length is filtered to obtain a corpus sample set; the corpus-type original data containing multiple sentences in the description content is divided into multiple separate sentences, and a sentence vector is generated for each sentence, and the clauses describing poor water quality are selected and added to the corpus sample set;

[0017] Use the sentence embedding model to vectorize the corpus samples in the corpus sample set to generate sentence vectors;

[0018] In the dual-tower architecture, the model input is two sentences; the pre-trained model is used as the embedding function to convert each sentence into an embedding vector in the embedding layer; the defined distance function is used as the similarity measurement function to calculate the similarity between the two embedding vectors.

[0019] Preferably, the step of obtaining typical semantic label examples includes:

[0020] The different topic types of river patrol descriptions in the typical corpus data describing river and lake problems are grouped and aggregated, and semantic clustering is performed on the grouped topics after grouping and aggregation to obtain different clusters.

[0021] The Bertopic topic model is used to perform topic modeling on the corpus samples of the grouped topics after grouping and aggregation, and multiple grouped topics are generated; for each grouped topic, the representative corpus samples of the grouped topic are screened out through representative documents in the topic modeling results;

[0022] Combined with the corresponding domain expertise, the representative corpus samples selected from each grouping theme are assigned corresponding "high risk", "medium risk" and "low risk" labels to construct representative typical semantic label samples.

[0023] Further preferably, the collected corpus-type raw data is corpus information describing river and lake problems reported by various types of river patrol services;

[0024] The corpus-type original data describing river and lake problems reported by municipal river patrols are selected as the corpus-type original data describing river and lake problems that are typically representative.

[0025] Preferably, the step of obtaining semantic label sample set data includes:

[0026] The constructed sentence embedding model is used to encode sentences of typical semantic label examples and turn them into query vectors. Then, a similarity search is performed in the vectorized corpus semantic vector set, and the sentence vector with the closest semantics obtains the same label as the query vector.

[0027] In an embodiment of the present invention, a river and lake water environment early warning method based on semantic tag construction includes the following steps:

[0028] The semantic label construction method is used to construct semantic labels describing river and lake issues, and obtain semantic label sample set data;

[0029] Collecting raw numerical data through equipment, processing the raw numerical data using feature engineering technology, and obtaining numerical feature sample set data;

[0030] Align and fuse the semantic label sample set data with the numerical feature sample set data to obtain a model training data sample set;

[0031] Use the model training data sample set to train the river and lake water environment early warning model;

[0032] Use the trained river and lake water environment early warning model to conduct early warning analysis of the river and lake water environment.

[0033] Preferably, in the process of training the river and lake water environment early warning model using the model training data sample set, the river and lake water environment early warning model is used to identify the unlabeled samples that are most helpful to the performance of the early warning model as query samples, and then manual labeling of the query samples is requested, and the manual labeling of the query samples is completed in the river patrol business.

[0034] In an embodiment of the present invention, a river and lake water environment early warning system based on semantic tags includes the following modules:

[0035] The label sample set building module uses the above-mentioned semantic label building method to build semantic labels describing river and lake issues and build semantic label sample set data;

[0036] Water quality information collection equipment, used to collect numerical raw data, process the numerical raw data through feature engineering technology, and obtain numerical feature sample set data;

[0037] A model training data acquisition module is used to align and fuse the semantic label sample set data with the numerical feature sample set data to obtain a model training data sample set;

[0038] The training module uses the model training data sample set to train the river and lake water environment early warning model;

[0039] The early warning module uses the trained river and lake water environment early warning model to conduct early warning analysis of the river and lake water environment.

[0040] Compared with the prior art, the technical effects achieved by the present invention include:

[0041] 1. The present invention collects the water quality description corpus from routine river patrol operations such as river patrols by first-line river chiefs, ordinary public patrols, superior inspectors’ patrols, and municipal patrols as water quality information description data, realizing large-scale data collection of river section information at a high frequency across the entire region; and vectorizes the corpus data based on the pre-trained model of large-scale corpus, which is easy to implement. Therefore, the present invention can use the corpus describing water quality conditions to construct semantic labels, improve the efficiency of data collection, and reduce the cost of data sample annotation, innovatively solving the problem that the current training data and model performance are limited by the coarse time granularity and sparse spatial distribution of water quality detection data.

[0042] 2. During the implementation of the present invention, water quality information data of the river section is obtained, and the noise signal in the data is reduced as much as possible; in other words, the present invention improves the quantity and quality of water quality label data from the two aspects of space (coverage) and time (time series granularity).

[0043] 3. When collecting data, the present invention is based on crowdsourcing ideas and technologies, combined with the actual river patrol business based on the river chief system. The patrol work of the first-line river chief covers all river sections, and the time granularity of the patrol data archiving is daily data; therefore, the first-line river chief’s description of the water quality of the patrolled river section can be converted into semantic labels about water quality information through an embedding model; through the combination of existing numerical feature data (features) and semantic label data (semantic labels), a training data set for a supervised learning model can be obtained. Therefore, the data collection of the present invention is convenient; and because of the use of crowdsourcing ideas, the river chief needs to patrol the river, the inspection team needs to spot check the river and lake conditions, and enthusiastic citizens can also report river and lake problems. Everyone can participate in water management, and the solution of the present invention is also highly scalable.

[0044] 4. Compared with water quality detection data, although the noise signals carried by semantic-based water quality information data may not be less, if the policy requires river chiefs who patrol rivers and lakes to provide necessary descriptions of water quality conditions, the quantity and quality of water quality data based on semantic information will be greatly improved, thereby obtaining a large amount of training data and ensuring the practicality of machine learning algorithms. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 Flow chart of the river and lake water environment early warning method in an embodiment of the present invention;

[0046] Figure 2 A data flow diagram for semantic label construction and model training in an embodiment of the present invention;

[0047] Figure 3 This is a statistical comparison chart of the proportion of each type of question in the embodiment of the present invention;

[0048] Figure 4 It is a score graph of topic analysis of corpus data in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto. Example

[0050] This embodiment provides a river and lake water environment early warning method based on semantic label construction, which uses an embedding model to convert natural language corpus sentences into numerical vectors of fixed length, extracts label data about water quality information from a large amount of corpus data describing the water quality of rivers and lakes, and constructs semantic labels for the river and lake water environment early warning model; on the whole, NLP technology is used to achieve low-cost and large-scale expansion of data quantity and improvement of data quality, thereby improving the predictive performance of the river and lake water environment early warning model.

[0051] The overall implementation process of the river and lake water environment early warning method constructed based on semantic tags in this embodiment is as follows: Figure 1 As shown. In the entire implementation process, the key lies in the construction of semantic labels and the training of river and lake water environment early warning models. This embodiment designs sample annotation, transforms the large-scale manual annotation process into a process of constructing typical semantic label examples, realizes the construction of semantic labels, and thus obtains efficient and low-cost sample annotation results. After the semantic labels are constructed, the training data is used to train the river and lake water environment early warning model (such as a supervised learning classifier model), and the early warning results generated by the model are applied to specific river and lake inspections and other water management tasks, forming an iterative optimization cycle. The overall process of the above-mentioned semantic label construction and model training can be expressed in the form of a data flow diagram (Data Flow Diagram), as shown in Figure 2.

[0052] In terms of data type, the data involved in this embodiment includes corpus data and numerical data. The former is mainly obtained through the corpus information describing the water quality of rivers and lakes reported in the river patrol business, and the latter is mainly obtained through data acquisition equipment. The following describes in detail the various steps mainly included in the early warning method of this embodiment:

[0053] S1. Collect corpus-type raw data describing river and lake issues, process the corpus-type raw data, construct semantic labels, and obtain typical semantic label samples.

[0054] Constructing semantic labels is actually to extract information about river and lake water quality from the corpus describing river and lake problems as label data for training examples.

[0055] All historical data involved in this embodiment span from July 2017 to April 2024. Based on the reported river and lake problems, the total number of samples is more than 360,000, and the total number of samples related to river sections is 291,503. At the business level, the river and lake problems reported in the river patrol business mainly include the following types: "industrial pollution", "agricultural pollution", "others", "water quality", "violations", "garbage", "drainage facilities", "illegal construction", "scattered pollution sources", "construction waste", "yards and docks", "facility safety", "garbage", and "public opinion", and each type of river and lake problem comes with a specific description of the situation of that type of problem. The description content varies from person to person, time to time, and place to place, and it is normal for the quality to vary.

[0056] Corpus-type raw data is corpus information describing river and lake problems reported by various types of river patrol services. When collecting corpus-type raw data describing river and lake problems, this embodiment designs and adjusts crowd-sourcing ideas and technologies to adapt to various types of river patrol services (including first-line river chiefs’ river patrols, ordinary public river patrols, superior supervisors’ river patrols, and municipal river patrols, etc.), so that in the process of executing various types of river patrol services, data collection of river section information in the entire region is carried out on a large scale at a high frequency to obtain corpus-type raw data; and the data of river patrol inspections and feedback from outsourced professional patrol teams are used to improve the overall data quality. Crowdsourcing objects include professional patrol teams, volunteers participating in water management activities, and enthusiastic citizens who care about the water environment. Different from crowdsourcing in the conventional sense, first-line river chiefs can ensure the quality of data collection as much as possible through certain administrative reward and punishment measures, while ordinary citizens can improve data quality through rewards. From the perspective of both time and space coverage, the first-line river chiefs’ river patrols scattered across the country and carried out at a certain frequency are the dominant contributing factors to ensure effective data collection.

[0057] Therefore, an important component of the corpus-type original data is the corpus data describing river and lake problems reported by first-line river chiefs during river patrols, and a secondary component is the corpus data describing river and lake problems reported by municipal-level river patrols, river and lake problems reported by the general public during river patrols, and other corpora such as complaints.

[0058] Combining the above data collection strategies, the collection efficiency and quality of machine learning training data can be effectively improved. Taking the historical data of the river chief system as an example, starting from the implementation of data crowdsourcing collection measures, from January 2023 to April 2024, the total number of samples is 53,816. The quantity distribution of each problem category is shown in Table 1 below.

[0059] Table 1. Distribution of the number of each question type

[0060]

[0061] All historical data in the system, that is, the time span is from 2017-07 to 2024-04, the total number of samples is 291503, and its statistics are shown in Table 2 below.

[0062] Table 2. Statistics of system historical data

[0063]

[0064] It can be seen that the proportion of some more serious problems (such as industrial pollution) has dropped significantly, while the proportion of relatively minor problems (such as garbage problems) has also increased significantly, which represents an improvement in the overall water environment. Figure 3 Intuitively show the changes in the number of each question.

[0065] Taking into account the overall positive trend of the actual water environment, this embodiment will not only consider data after 2023, but also use data from earlier times when constructing typical semantic label examples in the future. Otherwise, the descriptions of serious problems that have occurred will be artificially filtered, resulting in the loss of important information. Moreover, serious problems that are rare today do not mean that they will not occur in the future. The model should be able to effectively capture such problems. Another thing to consider is that the quality of corpus data varies, that is, for the same serious problem, some inspectors can describe the actual situation more objectively, while others avoid the important issues. Therefore, this embodiment is based on the historical data of key river sections defined in the river patrol business (197 key tracking river sections and other river sections with water quality monitoring, a total of about 600 river sections, with monthly water quality data), and some samples of the randomly sampled data set are shown in Table 3 below.

[0066] Table 3. Historical data of some river sections

[0067]

[0068] The full text of the problem description of the first sample is: "Beside the road outside No. 17, xx North Lane 1, xx Village, xx Town, xx District, there is a pipe that directly discharges sewage into the river. The water is dirty and black, with a pungent smell, and there is milky white dirt remaining. It is suspected that the direct discharge of sewage has polluted the water quality and water body." This description is obviously different from the description of the fourth sample, "domestic waste". The former provides specific information about the water quality of the river section, while the latter has no way to analyze the corresponding water quality conditions.

[0069] From the application point of view, the operation of river patrol business needs to distinguish rivers and lakes at different warning levels (such as predefined labels such as "high risk" and "low risk", etc.), that is, technically it is necessary to realize the mapping from a corpus describing river and lake problems to a certain warning level. Therefore, it is necessary to find a certain warning level expressed in a corpus describing river and lake problems, that is, it is necessary to label these corpus samples.

[0070] One of the annotation methods is data crowdsourcing annotation: when city-level river patrol inspectors report river and lake problems, they need to provide more information about the key river sections than ordinary front-line river chiefs, such as the traceability of pollution sources, the severity of the problem, and rapid water quality testing on site. The key river sections are pre-defined in the river patrol business. Compared with other data sources, the number of these data samples is not high, but the data quality is high. Based on these high-quality data samples, we can use technologies such as semantic topic analysis modeling to construct typical semantic label examples that map from river and lake problem description corpus to warning level. When crowdsourcing annotation, the annotation task can be divided into subtasks suitable for different crowdsourcing objects, and a clear river chief river patrol annotation guide can be designed; electronic platforms (such as the "Building a Clear Water Dream Together" platform) are used to publish annotation tasks to attract public participants. Participants perform annotations according to the guidelines. In addition to describing the problems on the river section, they can also upload image data and describe the water quality. The annotation quality is guaranteed by various methods, such as multiple annotations (the same river section is independently inspected by multiple people).

[0071] Another way to label is to use the sentence vector of the reference sample as the search vector (query vector), perform a similarity matching search on the entire corpus vector set (completed with the help of the FAISS engine), and set a threshold to obtain a sufficiently similar similarity vector. Since the label corresponding to the sample sentence (that is, the search vector) is known, samples similar to it will be labeled with this label, thereby completing the semantic label assignment.

[0072] This embodiment processes the original corpus data, and the core steps of constructing semantic tags include:

[0073] S11. Preprocess the corpus-type original data to obtain a corpus sample set, use the sentence embedding model to vectorize the corpus samples in the corpus sample set, generate sentence vectors, and obtain a vectorized corpus semantic vector set.

[0074] This step vectorizes all corpus-type raw data (including corpus sample sentences) to prepare for the subsequent construction of semantic tags.

[0075] The corpus-type raw data is cleaned routinely, and then enters the corpus sample vectorization processing flow. This embodiment uses an embedding model that has been fine-tuned or pre-trained on ordinary Chinese corpus to vectorize the sentences describing river and lake issues to obtain a real number vector of fixed length, paving the way for subsequent semantic topic modeling and vector similarity retrieval.

[0076] Common Transformer models (such as BERT, GPT, etc.) are deep learning models based on the self-attention mechanism, which are usually used to generate contextual embeddings of sentences or sequences. These embeddings can be used for various natural language processing (NLP) tasks, such as classification, translation, and generation tasks. The core idea, pre-training tasks, and model output of the common Transformer model can be simply described as follows:

[0077] 1. Self-attention mechanism: Through the self-attention mechanism, the model can capture the relationship between each word and other words in the sentence, thereby capturing the complete contextual meaning and solving the problem that recurrent neural networks (RNNs) cannot efficiently perform parallel calculations.

[0078] 2. Pre-training tasks: Unsupervised pre-training tasks such as masked language models (MLM) or autoregressive language models (such as GPT) are usually used to learn the representation of vocabulary and sentence structure. Through pre-training on large-scale corpus data, the model can learn to represent language structure, syntactic rules, and vocabulary meaning. These "skills" learned from massive data need to be "stimulated" (fine-tuned training) in downstream tasks to obtain performance that matches the domain goals.

[0079] 3. Model output: The output vector representation is usually based on each word, that is, the embedding of each word in the sentence.

[0080] The Sentence Transformer model is a variant of the Transformer model specifically designed to map the entire sentence into a fixed-size vector space. It is based on the Transformer architecture (such as BERT) and is further fine-tuned to provide meaningful vector representations at the sentence level. Specifically: The Sentence Transformer model adopts a dual-tower architecture (Siamese Network), that is, two sentences are input into two independent but weight-shared Transformer encoders, and then the similarity between the sentences is calculated through some distance metric (such as cosine similarity). In order to enable the model to generate sentence-level representations, the Sentence Transformer model is fine-tuned on specific tasks, such as sentence-pair tasks, such as semantic text similarity (STS), natural language inference (NLI), etc. After pre-training on large-scale text data, the Sentence Transformer model is further fine-tuned through contrastive learning or supervised learning to optimize the semantic representation at the sentence level. The training data involves paired sentences or labeled datasets for learning the similarities and differences between sentences. After fine-tuning training, the model can directly map the entire sentence into a vector space of fixed size, thereby better serving downstream tasks such as similarity calculation, clustering and classification.

[0081] The specific steps of performing vectorization processing on corpus samples in this embodiment include:

[0082] S111. Establish a sentence embedding model and set up a dual-tower architecture for the sentence embedding model.

[0083] The dual-tower architecture is as follows:

[0084] 1. Model input: x1 and x2, which are two input sentences.

[0085] 2. Embedding layer: Use pre-trained models, such as ERT / RoBERTa, FastText, etc., as the embedding function to convert each sentence into an embedding vector in the embedding layer.

[0086] Let f(x) be the conversion function (actually a neural network), then the two embedded vectors after conversion are: e1=f(x1) and e2= f(x2).

[0087] 3. Similarity metric function: Use a defined distance function as the similarity metric function to calculate the similarity (or distance) between two embedded vectors, such as Euclidean distance, cosine similarity, etc.

[0088] 4. Loss function:

[0089] Use contrastive learning to train the dual-tower architecture (i.e., Siamese Networks); let y be the label (a label value of 1 means that the two sentences have similar meanings, and a label value of 0 means that the two sentences have different meanings), then the loss function L for calculating the contrastive loss can be defined as:

[0090] L(y,e1,e2)=y×D(e1,e2) 2 +(1-y) ×max(0,mD(e1,e2)) 2 ;

[0091] Among them, D(e1,e2) is the distance function (such as Euclidean distance); m is a preset threshold, which contributes to the loss only when the distance between two embedded vectors is lower than the preset threshold.

[0092] In practical applications, the choice of distance function is related to the downstream task objectives. For example, if the task is about semantic similarity, consider using cosine similarity distance. Finally, use the labeled sentences to fine-tune the model training on the dataset and then apply it to the downstream task.

[0093] S112. Preprocess the corpus-type original data describing river and lake issues to obtain a corpus sample set.

[0094] Since the sentence embedding models used for vectorization are mainly trained on the "sentence pair" dataset (although some embedding models support input lengths of up to 8k words), and the corpus describing river and lake problems is not necessarily a single sentence, it may be a single word or a long paragraph, which leads to poor representation of the vectorization results. Therefore, it is necessary to limit the corpus length of the corpus-type original data describing river and lake problems. Filter the corpus samples with a length lower than the preset length (such as 4 words) to obtain a corpus sample set; the length of the filtered corpus describing river and lake problems is counted to obtain the distribution shown in Table 4 below.

[0095] Table 4. Statistics of description content length after sample filtering

[0096]

[0097] Among them, the longest corpus sample has 466 characters and is a long corpus paragraph. Its actual content is: "At the location where the xx tributary merges into the xx tributary on the side of the road in front of the xx Primary School in xx Village, xx Street, xx District, the water quality of the river is turbid, with floating foam and odor. The initial on-site ammonia nitrogen value is about 25mg / L. After tracing the source, the following problems were found: 1. A large underground pipe was found to directly discharge sewage to the xx tributary below the public notice board of the small water body section of the xx tributary of the northwest Hengsan Road of xx. The water quality is turbid, with floating foam and odor. The initial on-site ammonia nitrogen value is about 30mg / L, which is suspected to be caused by overflow of sewage from the adjacent sewage pipe network. 2. A large underground channel was found to directly discharge sewage to the xx tributary about 150 meters downstream of the river beside the public notice board of the small water body section of the xx tributary of the northwest Hengsan Road of xx. The water quality is turbid and brown. , floating dirt, odor, the initial on-site ammonia nitrogen value is about 40mg / L, suspected of domestic sewage discharge from nearby enterprises and residential buildings. 3. A concealed pipe was found about 200 meters downstream of the river next to the public notice board of the small water body section of the xx tributary of the northwest Hengsan Road of xx. The sewage was directly discharged to the xx tributary. The water quality was turbid and white, with residual dirt and odor. The initial on-site ammonia nitrogen value was about 30mg / L, suspected of domestic sewage discharge from nearby enterprises. 4. A large concealed pipe and a concealed channel were found about 300 meters downstream of the river next to the public notice board of the small water body section of the xx tributary of the northwest Hengsan Road of xx. The sewage was directly discharged to the xx tributary. The water quality was turbid and white, with floating foam and odor. The initial on-site ammonia nitrogen value was about 30mg / L, suspected of domestic sewage discharge from nearby enterprises and residential buildings. The sewage eventually flowed into the xx tributary and polluted the water quality of the river. "

[0098] In addition, the corpus-type raw data (generally corpus paragraphs) with multiple sentences in the description content needs to be specially processed as follows: split the corpus sample into multiple separate sentences, then generate sentence vectors for each sentence, and select the sentence vectors describing poor water quality. This type of corpus sample only accounts for a very low proportion of all corpus samples (about 900:25000), but usually its description is more detailed and contains more water quality information, so it is added to the corpus sample set after sentence segmentation.

[0099] S113. Use the sentence embedding model to perform corpus sample vectorization processing on the corpus samples in the corpus sample set, generate sentence vectors, and obtain a vectorized corpus semantic vector set.

[0100] Vectorizing the corpus samples in the corpus sample set actually uses the language model pre-trained on large-scale common corpora (such as encyclopedia corpora, public edition books, etc.) to map them into a real high-dimensional space (such as 768 dimensions for BERT and 1024 dimensions for RoBERTa) to facilitate subsequent processing and learning by the machine learning model. Therefore, after these corpus samples are vectorized, the distribution of their samples in the vector space mainly depends on the similarity of the meaning of the corpus samples themselves.

[0101] S12. Using semantic topic modeling technology, based on the corpus-type original data describing river and lake problems reported by municipal river patrols, a mapping relationship is constructed from the river and lake problem description corpus to the river and lake water environment warning level, and the corresponding river section water quality risk level label is embedded in the corresponding corpus-type original data to obtain a typical semantic label example, namely {problem description sentence: risk level label}.

[0102] Since the corpus-type original data describing river and lake problems reported by the municipal river patrol are of high quality and typical and representative, this embodiment embeds appropriate river section water quality risk level labels into these high-quality corpus-type original data based on semantic topic modeling technology to form typical semantic label examples.

[0103] Specifically, in the corpus-type raw data describing river and lake problems reported by the city-level river patrol, each problem type represents a different aspect of the river section problem (which is also a different aspect of water management), and the meaning expressed by the description of each problem type can be manually defined according to the warning needs. For example, in the corpus reporting "garbage-type" problems, the following examples can be found: garbage problems; garbage on the shore; garbage floating on the water; a large number of dead branches and leaves floating on the water, turbid water; large areas of oil on the water surface, dead fish, and a pungent smell. In these examples, the content reflects the degree of water pollution in a progressive manner.

[0104] Combining the business experience of domain experts, we can construct typical semantic label examples. For example, for the corpus of the "industrial pollution" problem type, the label assigned to the corpus containing "suspected illegal discharge of industrial sewage, turbid and black river water" is "high risk", and the label assigned to the corpus containing "industrial wastewater discharge, sewage discharged from the drain" is "medium risk".

[0105] Are these few manually constructed semantic label examples representative enough in the sample set? For example, the example {a lot of garbage floating on the surface of the river, a large number of dead fish, and a bad smell: 'high risk'} will lead to a decrease in the quality of the vector similarity search results: limited by the representation ability of the embedding model, the corpus description "there is garbage in the river" may be similar to it, so the label given to the corpus description of "there is garbage in the river" is also "high risk", resulting in a serious decrease in label quality.

[0106] One of the original purposes of constructing semantic labels is to use as much historical data as possible to increase the number of training samples. However, this type of manually constructed typical examples sometimes rely on the understanding of the problem by domain experts. For example, in the garbage problem, when the description of the corpus sample is only "garbage problem", if it is only from a semantic point of view, such samples are unclear and should be filtered out; but combined with business logic, it can be considered that this problem actually means "no problem", and the corresponding label is "low risk", because if the river and lake problems are serious, the river chief has the obligation to report the problem in detail. Combined with Table 2, it can be seen that there are more than 90,000 samples of garbage problems, accounting for the highest proportion. If such samples are simply filtered, a large number of samples will not be able to participate in model training. In other words, the experience and knowledge of domain experts play an auxiliary role, and if used improperly, it will be counterproductive.

[0107] How to get representative sentences describing industrial pollution? Can the content of each question type be semantically subdivided into signals describing different levels of water pollution? Relying on domain expert knowledge can improve understanding of the problem, but more objective means are needed to solve problems such as sample representativeness and semantic fuzzy boundaries. This embodiment uses semantic topic modeling technology to solve these problems.

[0108] All the original data of the corpus type are descriptions of situations encountered during river inspections. If topic modeling is directly performed on the sample set of this original data of the corpus type, it is equivalent to extracting summary information from the sample set. Figure 4 The figure shows the score of the topic analysis of the sample set of the entire corpus raw data. Figure 4 It can be seen that each topic has a high degree of differentiation. There are topics that directly describe the water quality (Topic0, Topic2), topics that are indirectly related to the water quality (Topic1, Topic 6, Topic 7), and topics that are irrelevant to the water quality (Topic 3, Topic 4, Topic 5). In other words, different semantic topics can be distinguished from the general category, but it cannot directly help to construct typical semantic label samples, because the topics contained in the sample cannot be subdivided into semantic categories through this relatively simple and coarse-grained method.

[0109] In this embodiment, the description of river patrol issues in the corpus-type original data has corresponding subject concepts, such as "industrial pollution", "agricultural pollution", "drainage facilities", water quality "", etc., as shown in Table 2. The different subject types of the description of river patrol issues in the corpus-type original data are grouped and aggregated, and the grouped themes after grouping and aggregation are semantically clustered to obtain different cluster clusters.

[0110] Ideally, there should be only one dominant cluster. In fact, there are many clusters in each grouping topic. And the dominant ones (that is, the samples with the largest number of samples) are the samples that the clustering algorithm cannot cluster. This is because there are often no significant keywords in people's corpus descriptions of river and lake problems that are not serious or obvious. Such corpus descriptions will be filtered out due to unclear semantics in the existing technology.

[0111] Therefore, this embodiment also needs to use the Bertopic topic model (combining BERT and TF-IDF technology to generate high-quality topic models) to perform topic modeling on the corpus samples of grouped topics (such as "industrial pollution") after grouping and aggregation, and finally generate a total of 38 grouped topics (Topics). When modeling topics, in order to maintain the consistency of the embedding vector, the embedding model that comes with the Bertopic tool is not used for vectorization.

[0112] Table 5 lists some selected topics. The topic number "-1" represents sample content that cannot be clustered, that is, the clustering algorithm regards it as an outlier. For each group topic, in the topic modeling results, through keyword extraction (KeyBERT), the representative documents (Representative_Docs) are used to give the corpus samples that the Bertopic topic model considers to be representative of the group topic; by constructing typical semantic label samples and combining semantic vector similarity retrieval, these outlier corpus samples can be labeled (sample annotation is completed and data can be used), instead of discarding samples that cannot be clustered, avoiding the problem of a large number of samples being unable to participate in model training.

[0113] Table 5. Some topic modeling results generated using the Bertopic tool

[0114]

[0115] Through topic modeling, representative corpus samples are screened out; then, combined with corresponding domain expertise, corresponding "high risk", "medium risk" and "low risk" labels are assigned to the representative corpus samples screened out by each grouping theme, and finally a representative typical semantic label sample is constructed.

[0116] The typical semantic label sample construction method proposed in this embodiment has high scalability and flexibility through this fine-grained semantic topic modeling. The construction result of the two-classification label system is as follows:

[0117] example_text2label_d = { # H : High risk; L :Low risk "Suspected industrial wastewater discharge, river water is turbid, black and smelly": "H",

[0118] "Sewage from pipelines is discharged secretly into rivers and streams, ammonia nitrogen exceeds the standard, mostly for review issues": "H","Direct discharge of restaurant sewage is suspected of polluting water bodies, and the water bodies are black and smelly":"H",

[0119] "Sewage overflow at the outfall on sunny days":"H",

[0120] "Large oil stain on water surface":"H","Domestic garbage":"L",

[0121] "Garbage and dead fish floating on the river surface":"L","The water is normal, no odor":"L",

[0122] }

[0123] Other multi-classification tasks, such as three-classification, six-classification, etc., are similar.

[0124] S13. Based on typical semantic label samples, semantic vector similarity retrieval is adopted. The sentence embedding model is used to encode the "problem description sentence" of the typical semantic label sample to obtain the query vector (query). The query vector is used to perform similarity search on the corpus vector set. The searched results are annotated with the labels of the typical semantic label samples. The label assignment of the vectorized corpus samples in the corpus semantic vector set is completed, that is, sample annotation, and the semantic label sample set data is obtained.

[0125] After constructing typical semantic label samples, the sentences of typical semantic label samples are encoded through the constructed sentence embedding model to turn them into query vectors; then similarity search is performed in the vectorized corpus semantic vector set, and the sentence vector with the closest semantics can obtain the same label as the query vector, such as "high risk", "medium risk", "low risk", etc. Therefore, the most similar corpus samples can be returned through semantic vector similarity retrieval, and labels can be assigned to large-scale vectorized corpus samples.

[0126] FAISS (Facebook AI Similarity Search) is an efficient similarity search engine specifically designed to process large-scale vector data. FAISS can quickly calculate the similarity between vectors and return the most similar instances. In this embodiment, fast semantic similarity retrieval is provided to complete sample label assignment, i.e. sample annotation.

[0127] Taking the simplest Index Flat index type in FAISS as an example, it stores all vectors in memory and calculates the similarity of each pair of vectors, usually cosine similarity or Euclidean distance. The Index Flat type index directly calculates the score function and then returns the vector with the highest score as the most similar search result. In practical applications, in order to improve efficiency and save storage space, vectors are usually normalized, that is, the L2 norm of each vector is guaranteed to be 1. In this way, the inner product of the query vector in the similarity calculation formula is equivalent to cosine similarity. Another commonly used is the squared Euclidean distance.

[0128] Table 6 is a table showing the similarity search results on a corpus sample set without corpus segmentation (not vectorized); Table 7 is a table showing the similarity search results on a corpus sample set after corpus segmentation (after vectorization). Tables 6 and 7 show similarity search results based on the same constructed samples, whose labels are high risk (represented by "H"), and are sorted in ascending order by the similarity score (distance) field in the table. It can be seen that the corpus sample with the content description of "garbage floating" in Table 6 is labeled "high risk", and the distance score is ranked very high, which is seriously contrary to the assumption; and Table 7 shows that this embodiment can overcome the problems of the former after the corpus is vectorized, thereby ensuring high-quality annotation results.

[0129] Table 6. Similarity retrieval results on the corpus sample set without corpus paragraph splitting

[0130]

[0131] Table 7. Similarity retrieval results on the corpus sample set after corpus paragraph splitting

[0132]

[0133] S2. Collect numerical raw data through the equipment, use feature engineering (FE) technology to process the numerical raw data, and obtain numerical feature sample set data.

[0134] The equipment in this step is a device for monitoring water quality data, which can be an automatic monitoring station, an unmanned aerial vehicle, or a satellite remote sensing device. The processing using feature engineering technology includes data preprocessing, data exploratory analysis, and data mathematical feature construction, which can all be achieved using existing technologies.

[0135] S3. Align and fuse the semantic label sample set data with the numerical feature sample set data to obtain a model training data sample set.

[0136] After sample alignment and fusion, the semantic labels obtained by sample annotation (referred to as sample semantic labels) and labels based on water quality data monitoring (referred to as water quality labels) can be compared. Table 8 is the result of a random sampling in the data set. It can be seen that there are two labels for the same river section, one is a semantic binary classification label (sen_2cls, referred to as S2c), and the other is a water quality binary classification label (wqc_2cls, referred to as W2c); the values ​​corresponding to the labels, H is high risk, and L is low risk; their values ​​are inconsistent. According to the description of the reported river and lake problems (the "Description" field in the table), it is easy to see that the quality of the sample semantic labels of this embodiment is better. However, this is a small slice of random sampling and cannot well illustrate the overall situation. Therefore, it is necessary to train and evaluate the model by comparing the use of different label data, so as to further verify the effectiveness of this embodiment as a whole.

[0137] Table 8. A randomly sampled subset of samples with inconsistent semantic labels and water quality labels

[0138]

[0139] S4. Use the model training data sample set to train the river and lake water environment early warning model.

[0140] Among them, the river and lake water environment early warning model adopts a machine learning model, which can be a general machine learning model, a deep learning neural network model or a semi-supervised learning model.

[0141] The early warning model will be trained based on several different data sets to explore the path to improve the final performance of the model. The model used in this embodiment is based on a binary classification model, but is not limited to binary classification. The training methods of other multi-classification models are similar.

[0142] S41: The sample semantic label is consistent with the water quality label.

[0143] As mentioned above, the training data set can construct two different labeling systems, one based on sample semantic labeling information of reported river and lake problems, and the other based on river section water quality labeling information. Water quality labels have many limitations in both time and space, and sample semantic labels can alleviate these problems, but sample semantic labels are limited by the representation ability of sentence embedding models, the use of semantic data, etc. When the values ​​of these two labels are consistent, it can be considered that the model trained by this data subset has the best performance, because the noise signal of the label data is the lowest at this time.

[0144] In the training data set, a data subset (sample size: 6532) with sample semantic labels consistent with water quality labels was selected, and a gradient boosting tree model (XGBoost) was trained on this data set. The gradient boosting tree model achieved an accuracy of 92.15% on the training data. The confusion matrix of the three validation sets is as follows: [[289 82]

[0146] [48 1149]], [[303 79]

[0148] [38 1147]], [[271 69] [53 1174]];

[0151] The gradient boosted tree model achieved 91.74% accuracy on the test set. The specific confusion matrix is ​​as follows: [

[14135]

[19459] ];

[0154] Due to the irreducible errors in the data of the actual task and the corruption in the label data, it is impossible for the machine learning model based on the data to obtain 100% prediction accuracy. Therefore, the results obtained in this data subset can be regarded as a reference upper limit in this task.

[0155] S42: The sample semantic label is inconsistent with the water quality label.

[0156] When comparing the quality of labeled data, the advantage of water quality labels is that they are objective measurements of water quality in river sections. Their disadvantage is that the data is sparse, and the process of upsampling for data alignment introduces noise signals. The advantage of sample semantic labels is that they have higher coverage and do not have the problem of water quality data alignment, but they are subjective (the description of river and lake problems is done by humans).

[0157] Therefore, the minimum requirement for reasonably evaluating the effectiveness of sample semantic labels is that the model's prediction performance is no worse than that of the model trained with water quality labels on the same scale of data.

[0158] In the training dataset, two data subsets with inconsistent label values ​​are obtained, and a data subset based on sample semantic labels (denoted as dataset_nlp) and a data subset based on water quality labels (denoted as dataset_wqc) are obtained, as shown in Table 9.

[0159] Table 9. List of data subsets with inconsistent values ​​for two labels

[0160]

[0161] On the sample semantic label dataset, the model achieved an average accuracy of 84.76% on the validation set, as shown below: [[2577 687]

[0163] [414 3539]], [[2636 677]

[0165] [413 3491]], [[2581 713] [393 3527]];

[0168] The accuracy on the test set was 85.01%, and the confusion matrix is ​​as follows: [[1053277] [1741504]];

[0171] On the water quality label dataset, the model achieved an average accuracy of 85.30% on the validation set, as shown below: [[2839 808]

[0173] [468 4670]], [[2801 818]

[0175] [489 4676]], [[2712 883] [407 4782]];

[0178] The accuracy on the test set was 84.81%, and the confusion matrix is ​​as follows: [[1203375]

[0180] [1811902]].

[0181] It can be seen that compared with the case of consistent labels, when the sample semantic label data is expanded by about 6 times (water quality label data is expanded by about 5 times), the prediction performance of the trained model is close to the model performance of the water quality label. However, with the increase of semantic data and further improvement of data quality, optimization of model parameters and improvement of the representation ability of sentence embedding model, the model based on sample semantic labels has great potential for improvement.

[0182] S43. Iterative optimization of early warning models and data

[0183] In the iterative optimization process at both the data and river and lake water environment early warning model levels, the sample semantic label construction process can be considered as a generalized active learning. In active learning, the early warning model is used to identify the unlabeled samples that are most helpful to the performance of the early warning model, called query samples, and then these query samples are manually labeled; and the manual labeling of the above query samples is completed in the river patrol business (such as the first-level river chief patrol business), which can achieve low-cost data quality improvement. The following is an example of active learning:

[0184] 1. Initial model training: Train an initial model using existing labeled data.

[0185] 2. Query strategy application: The model selects samples that need to be labeled based on a query strategy (such as uncertainty sampling, representative sampling, etc.).

[0186] 3. Sample labeling: Manually label the selected samples and add them to the training dataset.

[0187] 4. Model retraining: Retrain the model using the expanded training dataset.

[0188] 5. Iteration process: Repeat the above steps to continuously improve the model.

[0189] S5. Use the trained river and lake water environment early warning model to conduct early warning analysis on the river and lake water environment.

[0190] In specific water management tasks such as river and lake inspections, the trained river and lake water environment early warning models are used to conduct early warning analysis of the river and lake water environment.

[0191] This embodiment also provides a river and lake water environment early warning system based on semantic tags, which specifically includes the following modules:

[0192] The label sample set establishment module uses step S1 to construct semantic labels describing river and lake issues and establish semantic label sample set data;

[0193] Water quality information collection equipment, used to collect numerical raw data, process the numerical raw data through feature engineering technology, and obtain numerical feature sample set data;

[0194] A model training data acquisition module is used to align and fuse the semantic label sample set data with the numerical feature sample set data to obtain a model training data sample set;

[0195] The training module uses the model training data sample set to train the river and lake water environment early warning model;

[0196] The early warning module uses the trained river and lake water environment early warning model to conduct early warning analysis of the river and lake water environment.

[0197] From the above technical solutions, it can be seen that by combining NLP technologies (such as sentence-transformer, FAISS and Bertopic), low-cost and high-efficiency sample annotation can be effectively achieved. The present invention can obtain a model with high predictive performance by constructing semantic labels based on natural corpus in the river chief system data, and this method provides flexibility and high scalability. This method not only improves the annotation speed and consistency, but also reduces the cost of manual annotation. These technologies can be further optimized and expanded and applied to similar fields to improve the automation level and accuracy of sample annotation, and ultimately improve the actual performance of the early warning prediction model under field data.

[0198] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A semantic tag construction method, characterized in that: The following steps are involved: Collect corpus-type raw data describing river and lake issues; Preprocess the corpus-type raw data to obtain a corpus sample set, use the sentence embedding model to vectorize the corpus samples in the corpus sample set, generate sentence vectors, and obtain a vectorized corpus semantic vector set; Using semantic topic modeling technology, we selected typical corpus-type raw data describing river and lake problems, constructed a mapping relationship from river and lake problem description corpus to river and lake water environment warning level, and embedded the corresponding river section water quality risk level label into the corresponding corpus-type raw data to obtain a typical semantic label sample, namely {problem description sentence: risk level label}; According to typical semantic label samples, semantic vector similarity retrieval is adopted, and the "problem description sentence" of typical semantic label samples is encoded by sentence embedding model to obtain query vector. The query vector is used to perform similarity search on the corpus vector set, and the searched results are annotated with the labels of typical semantic label samples. The vectorized corpus samples in the corpus semantic vector set are labeled to obtain semantic label sample set data; The steps to generate a sentence vector include: Establish a sentence embedding model and set up a dual-tower architecture for the sentence embedding model; The corpus length of the corpus-type original data describing river and lake problems is limited, and the corpus-type original data with a length less than the preset length is filtered to obtain a corpus sample set; the corpus-type original data containing multiple sentences in the description content is divided into multiple separate sentences, and a sentence vector is generated for each sentence. The sentence vector describing poor water quality is selected and added to the corpus sample set; Use the sentence embedding model to vectorize the corpus samples in the corpus sample set to generate sentence vectors; In the dual-tower architecture, the model input is two sentences; the pre-trained model is used as the embedding function, and each sentence is converted into an embedding vector in the embedding layer; the defined distance function is used as the similarity measurement function to calculate the similarity between the two embedding vectors; the dual-tower structure is trained using contrastive learning, and the loss function L for calculating the contrastive learning loss is defined as: <h2 style=";text-align:left;direction:ltr">L(y,e1,e2)=y×D(e1,e2)<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> +(1-y) ×max(0,mD(e1,e2))<h2 style=";text-align:left;direction:ltr"> 2 <h2 style=";text-align:left;direction:ltr"> ; Where D(e1,e2) is the distance function; m is the preset threshold, which contributes to the loss only when the distance between two embedding vectors is lower than the preset threshold; y is the label; The steps to obtain typical semantic label samples include: The different topic types of river patrol descriptions in the typical corpus data describing river and lake problems are grouped and aggregated, and semantic clustering is performed on the grouped topics after grouping and aggregation to obtain different clusters. The Bertopic topic model is used to perform topic modeling on the corpus samples of the grouped topics after grouping and aggregation, and multiple grouped topics are generated; for each grouped topic, the representative corpus samples of the grouped topic are screened out through representative documents in the topic modeling results; Combined with the corresponding domain expertise, the representative corpus samples selected from each grouping theme are assigned corresponding "high risk", "medium risk" and "low risk" labels to construct representative typical semantic label samples.

2. The semantic tag construction method according to claim 1, characterized in that: The collected corpus-type original data are corpus information describing river and lake problems reported by various types of river patrol services; river patrol services include river patrols by first-line river chiefs, river patrols by the general public, river patrols by superior inspectors, and municipal-level river patrols; in the process of executing various types of river patrol services, data collection is carried out on a large scale on river section information across the entire region to obtain corpus-type original data.

3. The semantic tag construction method according to claim 2, characterized in that: The river and lake problems reported during river patrol operations include the following types: "industrial pollution", "agricultural pollution", "others", "water quality", "violations", "garbage", "drainage facilities", "illegal construction", "scattered pollution sources", "construction waste", "yards and docks", "facility safety", "garbage" and "public opinion". Each type of river and lake problem has a specific description of the situation of that type of problem.

4. The semantic tag construction method according to claim 1, characterized in that: The collected corpus-type raw data is corpus information describing river and lake problems reported by various types of river patrol services; The corpus-type original data describing river and lake problems reported by municipal river patrols are selected as the corpus-type original data describing river and lake problems that are typically representative.

5. The semantic tag construction method according to claim 1, characterized in that: The steps to obtain semantic label sample set data include: The constructed sentence embedding model is used to encode sentences of typical semantic label examples and turn them into query vectors. Then, a similarity search is performed in the vectorized corpus semantic vector set, and the sentence vector with the closest semantics obtains the same label as the query vector.

6. A river and lake water environment early warning method based on semantic tags, characterized in that: The following steps are involved: Using the semantic label construction method described in any one of claims 1 to 5, construct semantic labels describing river and lake issues, and obtain semantic label sample set data; Collecting raw numerical data through equipment, processing the raw numerical data using feature engineering technology, and obtaining numerical feature sample set data; Align and fuse the semantic label sample set data with the numerical feature sample set data to obtain a model training data sample set; Use the model training data sample set to train the river and lake water environment early warning model; Use the trained river and lake water environment early warning model to conduct early warning analysis of the river and lake water environment.

7. The river and lake water environment early warning method according to claim 6 is characterized in that: In the process of training the river and lake water environment early warning model using the model training data sample set, the river and lake water environment early warning model is used to identify the unlabeled samples that are most helpful to the performance of the early warning model as query samples, and then manual labeling of the query samples is requested, and the manual labeling of the query samples is completed in the river patrol business.

8. A river and lake water environment early warning system based on semantic tags, characterized in that: Includes the following modules: A label sample set building module, using the semantic label building method described in any one of claims 1 to 5 to build semantic labels describing river and lake issues and to build semantic label sample set data; Water quality information collection equipment is used to collect numerical raw data, process the numerical raw data through feature engineering technology, and obtain numerical feature sample set data; A model training data acquisition module is used to align and fuse the semantic label sample set data with the numerical feature sample set data to obtain a model training data sample set; The training module uses the model training data sample set to train the river and lake water environment early warning model; The early warning module uses the trained river and lake water environment early warning model to conduct early warning analysis of the river and lake water environment.

Citation Information

Patent Citations

  • Specific field multi-label text classification method based on small samples

    CN114491024A