CN116627915B - Dam emergency working condition event detection method and system based on slot semantic interaction - Google Patents

Dam emergency working condition event detection method and system based on slot semantic interaction Download PDF

Info

Publication number
CN116627915B
CN116627915B CN202310912326.0A CN202310912326A CN116627915B CN 116627915 B CN116627915 B CN 116627915B CN 202310912326 A CN202310912326 A CN 202310912326A CN 116627915 B CN116627915 B CN 116627915B
Authority
CN
China
Prior art keywords
word
decoder
trigger
slot
vector
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310912326.0A
Other languages
Chinese (zh)
Other versions
CN116627915A (en
Inventor
李锴凌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hohai University HHU
Original Assignee
Hohai University HHU
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hohai University HHU filed Critical Hohai University HHU
Priority to CN202310912326.0A priority Critical patent/CN116627915B/en
Publication of CN116627915A publication Critical patent/CN116627915A/en
Application granted granted Critical
Publication of CN116627915B publication Critical patent/CN116627915B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • G06N3/0455Auto-encoder networks; Encoder-decoder networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A10/00TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE at coastal zones; at river basins
    • Y02A10/40Controlling or monitoring, e.g. of flood or hurricane; Forecasting, e.g. risk assessment or mapping

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Machine Translation (AREA)

Abstract

The application discloses a dam emergency working condition event detection method and system based on slot semantic interaction, which are used for splitting and sorting dam safety operation log data; constructing a recognition problem template with slots, coding context vectors by using a BART model, realizing semantic interaction of slots by using cross attention, capturing context features related to trigger words, extracting the trigger word vectors, constructing a tag selector by combining the context vectors and the trigger word vectors, and labeling the trigger words; and filling the slot positions with the identified trigger words, constructing a classification problem template, extracting type feature vectors based on the semantic interaction of the slot positions, and classifying the trigger words, thereby realizing event detection. According to the method, external word segmentation and marking tools are not needed, the context association capability is enhanced through semantic interaction between the problem slot positions and the contexts, and classification accuracy reduction caused by the word ambiguity problem is avoided; the event detection is divided into two stages of trigger word recognition and classification, so that the generalization capability of the model is improved.

Description

Dam emergency working condition event detection method and system based on slot semantic interaction
Technical Field
The application relates to a dam emergency working condition event detection method and system based on slot semantic interaction, which are used for carrying out event detection on emergency working condition events and corresponding events contained in dam safety operation log data, and belong to the technical field of text data processing.
Background
The goal of event detection is to identify event trigger words from unstructured natural language text and to correctly classify event types. An event trigger word is a core element, typically a verb or noun phrase, that represents the occurrence of an event. Event types need to be predefined in the dataset. The event detection task is a key subtask of event extraction, and plays a fundamental role in event semantic modeling.
In the water conservancy field, the dam can play roles in flood control, power generation, water supply, shipping improvement and the like, and is economical, national defense and civil engineering are concerned. During the operation of the dam, the dam is easily affected by natural disasters such as flood, earthquake, storm and the like, and serious dam safety accidents can be possibly caused. Therefore, after special working conditions such as flood, debris flow, earthquake and the like occur, dam staff can timely conduct emergency treatment, investigation and evaluation, and emergency working condition events are recorded. Meanwhile, the dam inspection personnel can also conduct daily inspection and maintenance to form a daily inspection report. In the long-period operation process of the dam, a large amount of event record and inspection report data are accumulated, and important emergency working condition events are difficult to quickly excavate from the dam in a manual mode, so that the management and maintenance of the dam are not facilitated. Therefore, the automatic dam emergency condition event detection is of great significance.
The event consists of a trigger word and an event argument, wherein the trigger word has a word ambiguous phenomenon, and the context is required to be combined to judge the semantics; the traditional sequence labeling method has weak capability of combining the context, and is easy to pay attention to trigger words excessively, so that classification errors are caused; although the event detection method without the trigger word can solve the problem of word ambiguity, the lack of the trigger word is not beneficial to the subsequent event argument extraction task because the trigger word is a core unit of the event; in addition, the current Chinese event detection method often depends on external tools for word segmentation, part-of-speech tagging, named entity recognition and the like, and may introduce external errors, so that training difficulty is increased.
Disclosure of Invention
The application aims to: aiming at the problems and the defects existing in the prior art, the application introduces an encoder-decoder structure, provides a dam emergency working condition event detection method and system based on slot semantic interaction, does not need word segmentation or part-of-speech tagging in advance, enhances the context combining capability of a model through semantic interaction between a problem slot and a context, detects emergency working condition events from a dam safety operation log, tags event trigger words and event types thereof in documents, and facilitates the follow-up extraction of event arguments.
The technical scheme is as follows: a dam emergency working condition event detection method based on slot semantic interaction comprises the following steps:
step 1, data preprocessing: firstly, dividing a dam security operation log file into a plurality of documents according to dates, sequencing the documents, and dividing the documents into texts to be detected according to the maximum length; the splitting according to the date refers to dividing the whole log file into a plurality of documents according to the date recorded in the log file; the sorting refers to sorting the documents according to the recording date; the text to be detected refers to a text to be input into a BART model for event detection;
step 2, constructing a template for identifying the problems: constructing a recognition problem template with slots by using natural language, and filling words which are most in accordance with the meanings of the trigger words into the slots so as to guide the BART model to recognize the trigger words;
step 3, context coding: inputting the text to be detected into a BART model code to obtain a context vector;
step 4, extracting trigger word vectors based on slot semantic interaction: inputting the text to be detected and the recognition problem template into an encoder component and a decoder component of the BART model respectively, capturing context characteristics related to slot semantics by using the cross attention between the encoder and the decoder, and fusing the context characteristics into trigger word vectors;
step 5, constructing label selector label trigger words: constructing a BIO label selector by using a trigger word vector, calculating label scores of each word according to the context vector, calculating label sequence probability by using a conditional random field, and marking trigger words in a text to be detected;
step 6, constructing a classification problem template: constructing a classification problem template with slots by using natural language, filling the identified trigger words into the slots to obtain a problem template corresponding to each trigger word, and classifying each trigger word by using a guide model;
step 7, extracting type feature vectors based on slot semantic interaction and realizing classification: the text to be detected and the classification problem template are respectively input into an encoder component and a decoder component of the BART model, and the type feature vector of each trigger word is extracted by using the cross attention between the encoder and the decoder and classified according to the feature, so that dam emergency working condition event detection is realized.
Further, the dam emergency working condition event refers to typical events such as earthquake, debris flow, storm, flood discharge, pre-flood safety inspection, comprehensive inspection, daily inspection and the like.
Further, the step 1 includes the following steps:
step 1-1, firstly, dividing a dam safety operation log into a plurality of documents according to log record dates, and sequencing the documents according to a date sequence;
step 1-2, splitting each document into a plurality of sections of texts to be detected according to the maximum length of 512 characters, wherein 512 characters are the maximum input length acceptable by the BART model, and the length of the split texts does not exceed the maximum length and only consists of complete sentences.
Further, in the step 2, the construction form is "what < event >? The 'recognition problem template' is used for guiding the BART model to extract the characteristics of the trigger words, wherein 'event' is a slot filling word and can most represent the meaning of the trigger words.
Further, in the step 3, the text to be detected is detectedX={x 1 x 2 ,…,x N The BART model is a generating pre-training model and comprises a bidirectional encoder component and a unidirectional autoregressive decoder component, wherein the input is sequentially calculated by the encoder component and the decoder component, and the last layer of hidden vector sequence of the decoder is outputAs a context vector, the calculation formula is as follows: />
wherein ,Xis a text to be detected and is displayed,EncoderandDecoderthe encoder and decoder components of the BART model are represented separately,representation ofXWarp yarnEncoderThe last layer of hidden vector sequence obtained after calculation,H X is thatDecoderIs a sequence of last layer hidden vectors.
Further, the step 4 includes the following steps:
step 4-1, inputting the text to be detected into an encoder component of the BART model to obtain a last layer hidden vector sequence of the encoderWill->The decoder component inputs the BART model together with the recognition problem template in the step 2, the decoder component comprises a cross attention layer, receives hidden vectors from the encoder component and hidden vectors from the lower layer of the decoder, takes the hidden vectors of the encoder as keys and values, takes the hidden vectors of the lower layer of the decoder as query vectors, executes cross attention, thereby generating semantic interaction between the two inputs, and fuses the hidden vectors according to attention weights; the problem template and the text to be detected generate semantic interaction in the cross attention layer of the decoder component, so that the context characteristics are weighted and fused according to the semantic association degree between the context and the problem template, the context combining capacity of the model is enhanced, and the calculation formula is as follows:,/>, wherein ,Xis a text to be detected and is displayed,EncoderandDecoderencoder and decoder components, respectively representing the BART model,>representation ofXWarp yarnEncoderThe last layer of hidden vector sequence obtained after calculation,Decodertwo different inputs are accepted, and cross-attention is performed during the calculation,Q ide is a template for identifying problems, < >>For the last layer of the decoder, the sequence of hidden vectors comprisesQ ide A hidden state of each word in (a);
step 4-2, takingHiding vectors corresponding to the middle slot filling words and taking the average value to obtain trigger word vectorsH ide H ide The context characteristics related to the word are fused, wherein the slot filling word is an event in the step 2, corresponding to +.>The hidden vector of the "event".
Further, the step 5 includes the following steps:
step 5-1, defining B, I, O three labels for each word in the text to be detected, respectively representing the beginning of the trigger word, the middle of the trigger word and the non-trigger word, and utilizing the trigger word vector obtained in step 4H ide Constructing a label selector, wherein the calculation formula is as follows:
,/>,/>, wherein ,H ide is a trigger word vector, ++>、/>、/>Are trainable weight matrices, +.>Operator representing multiplication by element, ++>、/>、/>Respectively represent the selectors corresponding to the B, I, O labels;
step 5-2, using the context vector obtained in step 3H X With tag selector、/>、/>Constructing a label scoring function, wherein the calculation formula is as follows: />,/>
wherein ,、/>、/>respectively represent the first text to be detectediScore of B, I, O three tags of individual word, < ->Is an event context vectorH X Middle (f)iA plurality of sections;
step 5-3, after splicing the three label score sequences into one label score sequence according to the columns, inputting the label sequence calculated by the conditional random field layerY={y 1 y 2 ,…,y N Probability of the trigger word is obtained by using a Viterbi decoding algorithm, a trigger word label sequence with the highest score is obtained and is used as a trigger word recognition result, and a calculation formula is as follows:
wherein ,、/>、/>respectively represent the first text to be detectediScore of B, I, O three tags of individual word, < ->Represent the firstiIndividual word predictive tag asy i Score of->Representing the splicing in columns and rows,Tis a state transition matrix, ">Representing transition probability, learning inter-label constraint, correcting labeling boundary error, < ->Is any possible tag sequence, +.>Is the i-th tag value,/->Is a tag sequenceYIs a probability of (2).
Further, in the step 6,
what is the construction form "what is the event type for < slot >? "problem templates", wherein "< slot >" represents a slot to be filled, and after filling the slot with the trigger words identified in step 5, a classification problem template corresponding to the trigger words one-to-one is formed. For example, the classification problem template corresponding to the trigger word "heavy rain" is "what is the event type about heavy rain? ".
Further, the step 7 includes the following steps:
(7.1) template the classification problem in step 6Q cls The decoder component of the input BART model, the classification problem template is calculated by the lower layer of the decoder to obtain hidden vector, and the hidden vector of the encoder in the step 4 is hidden in the cross attention layer of the decoderThe interaction, weighted fusion context feature, is calculated as follows: />
wherein ,Decoderthe decoder component representing the BART model,the encoder concealment vector is represented as such,Decoderaccepting two different inputs and performing cross-attention during the calculation process,/->For the last layer of the decoder, the sequence of hidden vectors comprisesQ cls Hidden state of each word in the list.
(7.2) takingThe hidden vector of the last word in as a type feature vectorH cls Linear layerSoftmaxAnd calculating the function to obtain the type probability distribution of each trigger word, and then taking the type with the maximum probability as a classification result.
A dam emergency working condition event detection system based on slot semantic interaction comprises the following modules:
(1) And a data preprocessing module: dividing the dam security operation log into a plurality of documents according to the date, sequencing, and dividing the documents into texts to be detected according to the maximum length;
(2) BART reading understanding module: encoding the text to be detected by using the BART model to obtain a context vector; inputting the text to be detected and the problem template into an encoder component and a decoder component of the BART model respectively, capturing context characteristics related to slot semantics by using the cross attention between the encoder and the decoder, and fusing the context characteristics into trigger word vectors;
(3) The trigger word recognition module: constructing a BIO label selector by using the trigger word vector, and calculating label scores of each word according to the context vector; then, calculating the probability of a tag sequence by using a conditional random field, and marking trigger words in the text to be detected;
(4) The trigger word classification module: and respectively inputting the text to be detected and the classification problem template into an encoder component and a decoder component of the BART model, extracting the type feature vector of each trigger word by using the cross attention between the encoder and the decoder, and classifying according to the feature.
The implementation process and method of the system are the same and will not be described again.
The computer equipment comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein the processor realizes the dam emergency working condition event detection method based on slot semantic interaction when executing the computer program.
A computer readable storage medium storing a computer program for executing a dam emergency condition event detection method based on slot semantic interaction as described above.
The beneficial effects are that: compared with the prior art, the dam emergency working condition event detection method and system based on the slot semantic interaction provided by the application do not need to rely on external tools for word segmentation and part-of-speech tagging, so that the training difficulty is reduced, and external errors are avoided being introduced; the recognition and classification of the trigger words are realized in a question-answer mode by constructing a problem template with slots, semantic interaction between the slots of the problem and the context is realized by cross attention between an encoder and a decoder of the BART model, and the context characteristics are weighted and fused, so that the context association capability of the model is enhanced, and the classification accuracy reduction caused by word ambiguity problems is avoided; the trigger word recognition and classification are divided into two-stage tasks, so that the generalization capability of the model in the new field is improved; the detection and the marking of the emergency working condition event in the dam safety operation log are realized in an end-to-end mode, so that the text preprocessing cost is saved, and the manpower is saved.
Drawings
FIG. 1 is a flow chart of a method according to an embodiment of the present application;
FIG. 2 is a diagram of a model framework in accordance with an embodiment of the present application.
Detailed Description
The present application is further illustrated below in conjunction with specific embodiments, it being understood that these embodiments are meant to be illustrative of the application and not limiting the scope of the application, and that modifications of the application, which are equivalent to those skilled in the art to which the application pertains, fall within the scope of the application defined in the appended claims after reading the application.
As shown in FIG. 1, the dam emergency condition event detection method based on slot semantic interaction mainly comprises the following steps:
step 1, data preprocessing: firstly, dividing the dam security operation log into a plurality of documents according to log record dates, sequencing, and dividing the documents into texts to be detected according to the maximum length.
(1.1) first splitting the dam security travel log into a plurality of documents according to the recording date, and sorting the documents according to the date sequence.
And (1.2) splitting each document into a plurality of sections of texts to be detected according to the maximum length of 512 words, wherein the length of the split texts does not exceed the maximum length and only consists of complete sentences.
Step 2, constructing a template for identifying the problems: the recognition problem template with slots is constructed in natural language in the form of what < event > happens? "wherein" event "is a slot filler word to guide the model to recognize trigger words.
Step 3, context coding: and inputting the text to be detected into the BART model for encoding to obtain the context vector.
(3.1) given a length ofNTo be detected text of (a)X={x 1 x 2 ,…,x N },NRepresenting the text length, as shown in fig. 2, "2022, 9, 5, 12 and 52 minutes, the power plant rapidly performs on-site inspection work according to the related requirements of company" hydraulic building "when a 6.8-level earthquake occurs in luding county, ganjin, sichuan province.
(3.2) inputting the text to be detected into a BART model, wherein the BART model is a generated pre-training model and comprises a bidirectional encoder component and a unidirectional autoregressive decoder component, wherein the input is sequentially calculated by the encoder component and the decoder component, and the last layer of hidden vector sequence of the decoder is outputAs a context vector, the calculation formula is as follows: />,/>, wherein ,Xis a text to be detected and is displayed,EncoderandDecoderencoder and decoder components, respectively representing the BART model,>representation ofXWarp yarnEncoderCalculated to obtainThe last layer of the sequence of hidden vectors reached,H X is thatDecoderThe last layer of hidden vector sequence of (2) as in figure 2H X Representative inputXThe resulting context vector.
Step 4, extracting trigger word vectors based on slot semantic interaction: the text to be detected and the recognition problem template are respectively input into an encoder component and a decoder component of the BART model, and context features related to the problem slot semantics are captured and fused into trigger word vectors by utilizing the cross attention between the encoder and the decoder.
(4.1) inputting the text to be detected into an encoder component of the BART model to obtain a final layer hidden vector sequence of the encoderThe decoder component of the BART model is input together with the recognition problem template in the step 2, the decoder component comprises a cross attention layer, the hidden vector from the encoder component and the hidden vector from the lower layer of the decoder are accepted, the former is used as a key and a value, the latter is used as a query vector, cross attention is executed, so that semantic interaction is generated between the two inputs, and the hidden vectors are fused according to attention weights; the problem template and the text to be detected generate semantic interaction in the cross attention layer of the decoder component, so that the context characteristics are weighted and fused according to the semantic association degree between the context and the problem template, the context combining capacity of the model is enhanced, and the calculation formula is as follows: />, wherein ,Xis a text to be detected and is displayed,EncoderandDecoderencoder and decoder components, respectively representing the BART model,>representation ofXThe last layer of hidden vector sequence obtained after calculation,Decoderaccepting two different inputs and performing a crossover in the calculation processThe attention of the fork is paid to the fact that,Q ide is a template for the identification of the problem,for the last layer of the decoder, the sequence of hidden vectors comprisesQ ide Hidden state of each word in the list.
(4.2) takingHiding vectors corresponding to the middle slot filling words and taking an average value to obtain trigger word vectors, and fusing context features related to the words, wherein the slot filling words are events in the step 2 and correspond to ∈10>A hidden vector of the two words.
Step 5, constructing label selector label trigger words: constructing a BIO label selector by using the trigger word vector, and calculating label scores of each word according to the context vector; and then, calculating the probability of the tag sequence by using a conditional random field, and marking the trigger words in the text to be detected.
(5.1) defining B, I, O three labels for each word in the text to be detected, respectively representing the beginning of the trigger word, the middle of the trigger word and the non-trigger word, and utilizing the trigger word vector obtained in the step 4H ide Constructing a label selector, wherein the calculation formula is as follows:,/>,/>, wherein ,H ide is a vector of the trigger words and,、/>、/>are trainable weight matrices, +.>Operator representing multiplication by element, ++>、/>、/>The corresponding selectors to B, I, O labels are shown respectively.
(5.2) Using the context vector obtained in step 3H X With tag selector、/>、/>Constructing a label scoring function, wherein the calculation formula is as follows: />,/>,/>
wherein ,、/>、/>respectively represent the first text to be detectediScore of B, I, O three tags of individual word, < ->Is an event context vectorH X Middle (f)iA plurality of sections; as in figure 2 +.>、/>、/>And (3) withH X And calculating the dot product to obtain the BIO label score.
(5.3) after the three tag score sequences are spliced into one tag score sequence in columns, inputting the tag score sequence into the conditional random field layer to calculate the tag sequenceY={y 1 y 2 ,…,y N Probability of the trigger word is obtained by using a Viterbi decoding algorithm, a trigger word label sequence with the highest score is obtained and is used as a trigger word recognition result, and a calculation formula is as follows:
wherein ,、/>、/>score of B, I, O label, respectively, +.>Represent the firstiIndividual word predictive tag asy i Score of->Representing the splicing in columns and rows,Tis a state transition matrix, can learn the constraint among labels, correct the labeling boundary error, ++>Is any possible tag sequence, +.>Is a tag sequenceYIs a probability of (2).
For example, "2022, 9, 5, 12 hours and 52 minutes, sichuan Ganji Ludingxian, sichuan, develops a 6.8-level earthquake, and the power plant rapidly performs on-site inspection work according to the related requirements of the company" hydraulic building ". "BIO labeling results are as follows: O5O2O is divided into O when O5O 1O2O is taken in 2O0O2O2O year O9O month O5O, O four O Sichuan O, O.LO LuO Ding O.C.O.county O takes place at O6.8O grade O ground B earthquake I, O is built according to O and O is O.S. O & O Water O engineering O O building O related O requires O, O fast O open O of O electric O factory opens O and detects I check I work O of B field I. O (O)
Step 6, constructing a classification problem template: constructing a classification problem template with slots by using natural language, filling the identified trigger words into the slots to obtain a problem template corresponding to each trigger word, and classifying each trigger word by using a guide model;
what is the construction form "what is the event type for < slot >? A problem template of ' wherein ' slot ' represents a slot to be filled, and after filling the slot with the trigger words identified in step 5, a classification problem template corresponding to the trigger words one by one is formed; what are the classification problem templates "about the event type of the earthquake? What are the and's about the event types of the field check? ".
Step 7, extracting type feature vectors based on slot semantic interaction and realizing classification: and respectively inputting the text to be detected and the classification problem template into an encoder component and a decoder component of the BART model, fusing to obtain a type feature vector of each trigger word by using the cross attention between the encoder and the decoder, and classifying according to the feature.
(7.1) template the classification problem in step 6Q cls The decoder component of the input BART model, the classification problem template is calculated by the lower layer of the decoder to obtain hidden vector, and the hidden vector of the encoder in the step 4 is hidden in the cross attention layer of the decoderThe interaction, weighted fusion context feature, is calculated as follows: />, wherein , Decoderdecoder component representing BART model, +.>The encoder concealment vector is represented as such,Decoderaccepting two different inputs and performing cross-attention during the calculation process,/->For the last layer of the decoder, the sequence of hidden vectors comprisesQ cls Hidden state of each word in the list.
(7.2) takingThe hidden vector of the last word in as a type feature vectorH cls Linear layerSoftmaxThe function calculation obtains the type probability distribution of each trigger word, and then the type with the maximum probability is taken as a classification result; the trigger words "earthquake" and "live check" are classified as event types "earthquake" and "security check", respectively, as in fig. 2.
Dam emergency working condition event detection system based on slot semantic interaction comprises the following modules:
and a data preprocessing module: dividing the dam security operation log into a plurality of documents according to the date, sequencing, and dividing the documents into texts to be detected according to the maximum length;
BART reading understanding module: encoding the text to be detected by using the BART model to obtain a context vector; inputting the text to be detected and the problem template into an encoder component and a decoder component of the BART model respectively, and capturing context characteristics related to slot semantics by utilizing the cross attention between the encoder and the decoder;
the trigger word recognition module: constructing a BIO label selector by using the trigger word vector, and calculating label scores of each word according to the context vector; then, calculating the probability of a tag sequence by using a conditional random field, and marking trigger words in the text to be detected;
the trigger word classification module: and respectively inputting the text to be detected and the classification problem template into an encoder component and a decoder component of the BART model, extracting the type feature vector of each trigger word by using the cross attention between the encoder and the decoder, and classifying according to the feature.
The specific implementation of the system is the same as the method.
It will be apparent to those skilled in the art that the steps of the method for detecting dam emergency condition events based on slot level semantic interactions or the modules of the system for detecting dam emergency condition events based on slot level semantic interactions of the embodiments of the present application described above may be implemented by a general purpose computing device, they may be centralized on a single computing device, or distributed over a network of computing devices, or they may alternatively be implemented by program code executable by a computing device, so that they may be stored in a storage device to be executed by the computing device, and in some cases, the steps shown or described may be performed in a different order than herein, or they may be fabricated separately as individual integrated circuit modules, or a plurality of modules or steps of them may be fabricated as a single integrated circuit module. Thus, embodiments of the application are not limited to any specific combination of hardware and software.

Claims (10)

1. A dam emergency working condition event detection method based on slot semantic interaction is characterized by constructing a problem template with slots, extracting relevant features by using interaction between the problem slots and contexts, and carrying out event detection on a dam safety operation log, and comprises the following steps:
step 1, data preprocessing: firstly, dividing a dam security operation log file into a plurality of documents according to dates, sequencing the documents, and dividing the documents into texts to be detected according to the maximum length;
step 2, constructing a template for identifying the problems: constructing a recognition problem template with slots by using natural language, and filling words which are most in accordance with the meanings of the trigger words into the slots so as to guide the BART model to recognize the trigger words;
step 3, context coding: inputting the text to be detected into a BART model code to obtain a context vector;
step 4, extracting trigger word vectors based on slot semantic interaction: inputting the text to be detected and the recognition problem template into an encoder component and a decoder component of the BART model respectively, capturing context characteristics related to slot semantics by using the cross attention between the encoder and the decoder, and fusing the context characteristics into trigger word vectors;
step 5, constructing label selector label trigger words: constructing a BIO label selector by using a trigger word vector, calculating label scores of each word according to the context vector, calculating label sequence probability by using a conditional random field, and marking trigger words in a text to be detected;
step 6, constructing a classification problem template: constructing a classification problem template with slots by using natural language, filling the identified trigger words into the slots to obtain a problem template corresponding to each trigger word, and classifying each trigger word by using a guide model;
step 7, extracting type feature vectors based on slot semantic interaction and realizing classification: the text to be detected and the classification problem template are respectively input into an encoder component and a decoder component of the BART model, and the type feature vector of each trigger word is extracted by using the cross attention between the encoder and the decoder and classified according to the feature, so that dam emergency working condition event detection is realized.
2. The dam emergency condition event detection method based on slot semantic interaction according to claim 1, wherein the step 1 comprises the following steps:
step 1-1, firstly, dividing a dam safety operation log into a plurality of documents according to log record dates, and sequencing the documents according to a date sequence;
step 1-2, splitting each document into a plurality of sections of texts to be detected according to a set maximum length, wherein the set maximum length is the maximum input length acceptable by the BART model, and the split text length does not exceed the maximum length and only consists of complete sentences.
3. The method for detecting dam emergency condition event based on slot semantic interaction according to claim 1, wherein in the step 2, the recognition problem template is configured as "what < event >? "wherein" event "is a slot filler word.
4. The dam emergency condition event detection method based on slot semantic interaction according to claim 1, wherein the step 4 comprises the following steps:
step 4-1, inputting the text to be detected into an encoder component of the BART model to obtain a last layer hidden vector sequence of the encoderWill->The decoder component is used for inputting the BART model together with the recognition problem template, the problem template and the text to be detected generate semantic interaction in a cross attention layer of the decoder component, so that the context characteristics are weighted and fused according to the semantic association degree between the context and the problem template, and the calculation formula is as follows:
,/>, wherein ,Xis a text to be detected and is displayed,EncoderandDecoderencoder and decoder components, respectively representing the BART model,>representation ofXWarp yarnEncoderThe last layer of hidden vector sequence obtained after calculation,Decodertwo different inputs are accepted, and cross-attention is performed during the calculation,Q ide is a template for identifying problems, < >>For the last layer of the decoder, the sequence of hidden vectors comprisesQ ide A hidden state of each word in (a);
step 4-2, takingHiding vectors corresponding to the middle slot filling words and taking the average value to obtain trigger word vectorsH ide H ide The context characteristics related to the word are fused, wherein the slot filling word is an event, and the corresponding +.>The hidden vector of the "event".
5. The dam emergency condition event detection method based on slot semantic interaction according to claim 1, wherein the step 5 comprises the following steps:
step 5-1, defining B, I, O three labels for each word in the text to be detected, respectively representing the beginning of the trigger word, the middle of the trigger word and the non-trigger word, and utilizing the trigger word vectorH ide Constructing a label selector, wherein the calculation formula is as follows:,/>,/>
wherein ,H ide is a vector of the trigger words and,、/>、/>are trainable weight matrices, +.>Operator representing multiplication by element, ++>、/>、/>Respectively represent the selectors corresponding to the B, I, O labels;
step 5-2, utilizing the context vectorH X With tag selector、/>、/>Constructing a label scoring function, wherein the calculation formula is as follows: />,/>,/>, wherein ,/>、/>、/>Respectively represent the first text to be detectediScore of B, I, O three tags of individual word, < ->Is an event context vectorH X Middle (f)iA plurality of sections;
step 5-3, after splicing the three label score sequences into one label score sequence according to the columns, inputting the label sequence calculated by the conditional random field layerY={y 1 y 2 ,…,y N Probability of the trigger word is obtained by using a Viterbi decoding algorithm, a trigger word label sequence with the highest score is obtained and is used as a trigger word recognition result, and a calculation formula is as follows:
wherein ,represent the firstiIndividual word predictive tag asy i Score of->Representing the splicing in columns and rows,Tis a state transition matrix, ">Representing transition probability +.>Is any possible tag sequence, +.>Is the firstiThe value of the individual tag is used to determine,is a tag sequenceYIs a probability of (2).
6. The dam emergency condition event detection method based on slot semantic interaction according to claim 1, wherein in the step 6, the constructed problem template is "what is the event type of < slot >? And forming classification problem templates corresponding to the trigger words one by one after filling the slot positions to be filled with the trigger words, wherein "< slot >" represents the slot positions to be filled, and is used for classifying each trigger word.
7. The dam emergency condition event detection method based on slot semantic interaction according to claim 1, wherein the step 7 comprises the following steps:
(7.1) problem templates to be classifiedQ cls The decoder component of the input BART model, the classification problem template is calculated by the lower layer of the decoder to obtain hidden vector, and the hidden vector is hidden with the encoder in the cross attention layer of the decoderThe interaction, weighted fusion context feature, is calculated as follows: />
wherein ,Decoderthe decoder component representing the BART model,the encoder concealment vector is represented as such,Decoderaccepting two different inputs and performing cross-attention during the calculation process,/->For the last layer of the decoder, the sequence of hidden vectors comprisesQ cls A hidden state of each word in (a);
(7.2) takingThe hidden vector of the last word in as a type feature vectorH cls Linear layerSoftmaxAnd calculating the function to obtain the type probability distribution of each trigger word, and then taking the type with the maximum probability as a classification result.
8. The dam emergency working condition event detection system based on slot semantic interaction is characterized by comprising the following modules:
and a data preprocessing module: dividing the dam security operation log into a plurality of documents according to the date, sequencing, and dividing the documents into texts to be detected according to the maximum length;
BART reading understanding module: encoding the text to be detected by using the BART model to obtain a context vector; inputting the text to be detected and the problem template into an encoder component and a decoder component of the BART model respectively, capturing context characteristics related to slot semantics by using the cross attention between the encoder and the decoder, and fusing the context characteristics into trigger word vectors;
the trigger word recognition module: constructing a BIO label selector by using the trigger word vector, and calculating label scores of each word according to the context vector; then, calculating the probability of a tag sequence by using a conditional random field, and marking trigger words in the text to be detected;
the trigger word classification module: and respectively inputting the text to be detected and the classification problem template into an encoder component and a decoder component of the BART model, extracting the type feature vector of each trigger word by using the cross attention between the encoder and the decoder, and classifying according to the feature.
9. A computer device, characterized by: the computer equipment comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein the processor realizes the dam-oriented emergency working condition event detection method based on slot semantic interaction according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized by: the computer readable storage medium stores a computer program for executing the dam-oriented emergency condition event detection method based on slot semantic interaction according to any one of claims 1 to 7.
CN202310912326.0A 2023-07-25 2023-07-25 Dam emergency working condition event detection method and system based on slot semantic interaction Active CN116627915B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310912326.0A CN116627915B (en) 2023-07-25 2023-07-25 Dam emergency working condition event detection method and system based on slot semantic interaction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310912326.0A CN116627915B (en) 2023-07-25 2023-07-25 Dam emergency working condition event detection method and system based on slot semantic interaction

Publications (2)

Publication Number Publication Date
CN116627915A CN116627915A (en) 2023-08-22
CN116627915B true CN116627915B (en) 2023-09-19

Family

ID=87592454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310912326.0A Active CN116627915B (en) 2023-07-25 2023-07-25 Dam emergency working condition event detection method and system based on slot semantic interaction

Country Status (1)

Country Link
CN (1) CN116627915B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112507696A (en) * 2021-02-04 2021-03-16 湖南大学 Human-computer interaction diagnosis guiding method and system based on global attention intention recognition
CN115563253A (en) * 2022-09-05 2023-01-03 华南理工大学 Multi-task event extraction method and device based on question answering
CN115952791A (en) * 2022-12-24 2023-04-11 中国科学院新疆理化技术研究所 Chapter-level event extraction method, device and equipment based on machine reading understanding and storage medium
CN116340513A (en) * 2023-03-07 2023-06-27 湖南大学 Multi-label emotion classification method and system based on label and text interaction

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11663249B2 (en) * 2018-01-30 2023-05-30 Intel Corporation Visual question answering using visual knowledge bases
US11281976B2 (en) * 2018-07-12 2022-03-22 International Business Machines Corporation Generative adversarial network based modeling of text for natural language processing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112507696A (en) * 2021-02-04 2021-03-16 湖南大学 Human-computer interaction diagnosis guiding method and system based on global attention intention recognition
CN115563253A (en) * 2022-09-05 2023-01-03 华南理工大学 Multi-task event extraction method and device based on question answering
CN115952791A (en) * 2022-12-24 2023-04-11 中国科学院新疆理化技术研究所 Chapter-level event extraction method, device and equipment based on machine reading understanding and storage medium
CN116340513A (en) * 2023-03-07 2023-06-27 湖南大学 Multi-label emotion classification method and system based on label and text interaction

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Open language learning for information extraction;Orean Etzioni等;《Proceedings of the 2012 joint conference on Empirical methods in natural language processing and computational natural language learning》;523-534 *
低资源场景下的意图识别和语义槽填充联合方法研究;于梦诗;《中国优秀硕士学位论文全文数据库 信息科技辑》;I138-294 *

Also Published As

Publication number Publication date
CN116627915A (en) 2023-08-22

Similar Documents

Publication Publication Date Title
CN111143550B (en) Method for automatically identifying dispute focus based on hierarchical attention neural network model
CN109886270B (en) Case element identification method for electronic file record text
CN110162478B (en) Defect code path positioning method based on defect report
CN113204967B (en) Resume named entity identification method and system
CN112560486A (en) Power entity identification method based on multilayer neural network, storage medium and equipment
CN113095050A (en) Intelligent ticketing method, system, equipment and storage medium
CN114492460B (en) Event causal relationship extraction method based on derivative prompt learning
CN115292490A (en) Analysis algorithm for policy interpretation semantics
CN112036179B (en) Electric power plan information extraction method based on text classification and semantic frame
CN117909918A (en) Monitor fault prediction method and system based on fusion characteristics
CN116627915B (en) Dam emergency working condition event detection method and system based on slot semantic interaction
CN117077682B (en) Document analysis method and system based on semantic recognition
CN113901815B (en) Emergency working condition event detection method based on dam operation log
CN115860002B (en) Combat task generation method and system based on event extraction
CN112232078A (en) Scheduling operation ticket auditing method based on bidirectional GRU and attention mechanism
CN115482075A (en) Financial data anomaly analysis method and device, electronic equipment and storage medium
CN116362247A (en) Entity extraction method based on MRC framework
CN115936003A (en) Software function point duplicate checking method, device, equipment and medium based on neural network
CN113505207B (en) Machine reading understanding method and system for financial public opinion research report
CN114036908A (en) Chinese chapter-level event extraction method and device integrated with word list knowledge
CN114692596A (en) Deep learning algorithm-based bond information analysis method and device and electronic equipment
CN116579424B (en) Tunnel construction geological disaster prevention and control knowledge system construction method and system
CA3210419C (en) Method and system for extracting data from tables within regulatory content
Yong et al. Keywords-based dam defect image caption generation
CN115689493A (en) Neural network-based automatic auditing and rating method for power grid operation tickets

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant