CN110674303A - Event statement processing method and device, computer equipment and readable storage medium - Google Patents

Event statement processing method and device, computer equipment and readable storage medium Download PDF

Info

Publication number
CN110674303A
CN110674303A CN201910948382.3A CN201910948382A CN110674303A CN 110674303 A CN110674303 A CN 110674303A CN 201910948382 A CN201910948382 A CN 201910948382A CN 110674303 A CN110674303 A CN 110674303A
Authority
CN
China
Prior art keywords
event
statement
vectorization
coding
semantic
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.)
Granted
Application number
CN201910948382.3A
Other languages
Chinese (zh)
Other versions
CN110674303B (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.)
Beijing Zhizhi Heshu Technology Co ltd
Original Assignee
Beijing Mininglamp Software System Co ltd
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 Beijing Mininglamp Software System Co ltd filed Critical Beijing Mininglamp Software System Co ltd
Priority to CN201910948382.3A priority Critical patent/CN110674303B/en
Publication of CN110674303A publication Critical patent/CN110674303A/en
Application granted granted Critical
Publication of CN110674303B publication Critical patent/CN110674303B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06F16/353Clustering; Classification into predefined classes
    • 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/31Indexing; Data structures therefor; Storage structures
    • G06F16/313Selection or weighting of terms for indexing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Machine Translation (AREA)

Abstract

The embodiment of the invention provides an event statement processing method and device, computer equipment and a readable storage medium, and relates to the technical field of data processing. The method comprises the steps of firstly mapping each word in an event statement to obtain a vectorization statement corresponding to the event statement, carrying out linear transformation on the vectorization statement, mapping the vectorization statement subjected to linear transformation to a plurality of semantic spaces for processing to obtain a deep vectorization statement, splicing the deep vectorization statement and the vectorization statement to obtain a spliced statement vector, coding the statement vector to obtain coding features of the event statement, decoding the coding features of the event statement by using an event detection model obtained by training to obtain an event main body of the event statement, and simultaneously detecting the event type of the coding features of the event statement to obtain the event type of the event statement, thereby realizing the simultaneous detection of the event type of the event statement and the extraction of the event main body of the event statement.

Description

Event statement processing method and device, computer equipment and readable storage medium
Technical Field
The invention relates to the technical field of data processing, in particular to an event statement processing method, an event statement processing device, computer equipment and a readable storage medium.
Background
A large amount of data is generated on the internet every day, describing many events that have occurred. The method and the device can distinguish and identify the common events or events occurring in a specific industry, are helpful for grasping the development trend of the events and the development direction of the whole industry in real time, can assist high-level decision making, reduce risks and have important practical application value and research significance. At present, most of the existing methods only detect event types, do not extract event main bodies, have single tasks and do not have strong practical application value.
Disclosure of Invention
Based on the research, the invention provides an event statement processing method, an event statement processing device, computer equipment and a readable storage medium.
Embodiments of the invention may be implemented as follows:
in a first aspect, an embodiment of the present invention provides an event statement processing method, including:
mapping each word in an event statement to obtain a vectorization statement corresponding to the event statement;
performing linear transformation on the vectorization sentences, and mapping the vectorization sentences after the linear transformation to a plurality of semantic spaces for processing to obtain deep vectorization sentences;
splicing the deep vectorization statement and the vectorization statement to obtain a spliced statement vector;
encoding the statement vector to obtain the encoding characteristics of the event statement;
decoding the coding features of the event statement by using the trained event detection model to obtain an event main body of the event statement, and detecting the event type of the coding features of the event statement to obtain the event type of the event statement.
In an optional embodiment, the step of mapping the linearly transformed vectorized statement to a plurality of semantic spaces for processing to obtain a deep vectorized statement includes:
copying the vectorized sentences after the linear transformation to a plurality of semantic spaces by using a multi-head self-attention mechanism;
aiming at each semantic space, randomly initializing in the semantic space to obtain a target vectorization statement, and performing first matrix operation on the vectorization statement subjected to linear transformation in the semantic space and the target vectorization statement to obtain a first semantic matrix;
performing second matrix operation on the first semantic matrix and the vectorized sentences after linear transformation in the semantic space to obtain a second semantic matrix;
and splicing the second semantic matrix of each semantic space to obtain the deep vectorization statement.
In an optional embodiment, the step of encoding the statement vector to obtain the encoding characteristic of the event statement includes:
coding the statement vector according to a bidirectional long and short term memory network to obtain the output in a first direction and a second direction;
and splicing the outputs in the first direction and the second direction to obtain the coding characteristics of the event statement.
In an alternative embodiment, the event detection model includes a one-way long-short term memory network;
the step of decoding the coding features of the event statement to obtain the event body of the event statement comprises:
decoding the coding features of the event sentences by using the one-way long and short term memory network to obtain the probability that each word in the event sentences belongs to the event subject;
and obtaining the event main body of the event sentence according to the probability that each word in the event sentence belongs to the event main body.
In an alternative embodiment, the event detection model further comprises a convolutional neural network and a fully-connected network;
the step of detecting the event type of the coding feature of the event statement to obtain the event type of the event statement comprises:
performing pooling operation on the coding features of the event statements according to the convolutional neural network to obtain the coding features after the pooling operation;
inputting the coding features after the pooling operation into the full-connection network to obtain the probability that the event statement belongs to each event type;
and obtaining the event type of the event statement according to the probability that the event statement belongs to each event type.
In an alternative embodiment, the event detection model is trained by:
carrying out event main body marking and event type marking on each event statement in the training data set to obtain a marked event statement;
and aiming at each marked event statement, inputting the coding characteristics of the marked event statement into an event detection model to be trained for training, and adjusting the parameters of the event detection model to be trained through a back propagation algorithm based on a preset loss function until the output of the preset loss function is less than a preset threshold value.
In an optional embodiment, the event body label of each event statement in the training data set is implemented by a BIO labeling method.
In a second aspect, an embodiment of the present invention provides an event statement processing apparatus, where the apparatus includes a mapping module, a splicing module, a coding module, and a processing module;
the mapping module is used for mapping each word in an event statement to obtain a vectorization statement corresponding to the event statement, performing linear transformation on the vectorization statement, and mapping the vectorization statement after the linear transformation to a plurality of semantic spaces for processing to obtain a deep vectorization statement;
the splicing module is used for splicing the deep vectorization statement and the vectorization statement to obtain a spliced statement vector;
the coding module is used for coding the statement vector to obtain the coding characteristics of the event statement;
the processing module is used for decoding the coding features of the event statements by using the trained event detection model to obtain event main bodies of the event statements, and detecting the event types of the coding features of the event statements to obtain the event types of the event statements.
In a third aspect, an embodiment of the present invention provides a computer device, including a processor and a non-volatile memory storing computer instructions, where the computer instructions, when executed by the processor, perform the event statement processing method described in any one of the foregoing embodiments.
In a fourth aspect, an embodiment of the present invention provides a readable storage medium, where the readable storage medium includes a computer program, and the computer program controls, when running, a computer device on the readable storage medium to execute the event statement processing method described in any one of the foregoing embodiments.
The method, the device, the computer equipment and the readable storage medium for processing the event sentences provided by the embodiment of the invention comprise the steps of firstly mapping each word in the event sentences to obtain vectorized sentences corresponding to the event sentences, linearly transforming the vectorized sentences, mapping the vectorized sentences after linear transformation to a plurality of semantic spaces for processing to obtain deep vectorized sentences, splicing the deep vectorized sentences and the vectorized sentences to obtain spliced sentence vectors, coding the sentence vectors after obtaining the sentence vectors to obtain coding features of the event sentences, decoding the coding features of the event sentences by utilizing an event detection model obtained by training to obtain event main bodies of the event sentences, simultaneously detecting the event types of the event sentences to obtain the event types of the event sentences, further realizing the simultaneous detection of the event types of the event sentences and the extraction of the event main bodies of the event sentences, has strong practical application value.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a block diagram of an electronic device according to an embodiment of the present invention.
Fig. 2 is a schematic flow chart of an event statement processing method according to an embodiment of the present invention.
Fig. 3 is another schematic flow chart of the event statement processing method according to the embodiment of the present invention.
Fig. 4 is a schematic flowchart of another event statement processing method according to an embodiment of the present invention.
Fig. 5 is a schematic flowchart of another event statement processing method according to an embodiment of the present invention.
Fig. 6 is a schematic flowchart of another event statement processing method according to an embodiment of the present invention.
Fig. 7 is a schematic flowchart of another event statement processing method according to an embodiment of the present invention.
Fig. 8 is a block diagram of an event statement processing apparatus according to an embodiment of the present invention.
Icon: 100-an electronic device; 10-event statement processing means; 11-a mapping module; 12-a splicing module; 13-an encoding module; 14-a processing module; 20-a memory; 30-a processor; 40-a communication unit.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. indicate an orientation or a positional relationship based on that shown in the drawings or that the product of the present invention is used as it is, this is only for convenience of description and simplification of the description, and it does not indicate or imply that the device or the element referred to must have a specific orientation, be constructed in a specific orientation, and be operated, and thus should not be construed as limiting the present invention.
Furthermore, the appearances of the terms "first," "second," and the like, if any, are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
It should be noted that the features of the embodiments of the present invention may be combined with each other without conflict.
A large amount of news data is generated every day on the internet, describing many events that have occurred. However, due to the wide variety of events, the type of the event and the subject of the event cannot be quickly and accurately distinguished. The event body refers to a main participant of an event occurrence and is also the party most closely related to the event, and the event type refers to the category to which different events belong, for example, event types such as "real control personnel shareholder change", "credit violation", "financial fraud" and the like exist in the financial field.
At present, most of existing methods for processing event statements are based on a graph neural network or a deep learning and attention mechanism, but most of the existing methods only detect event types, do not extract event main bodies, have single tasks and do not have strong practical application values.
Moreover, most of the existing methods use specific natural language processing tools, such as Jieba, Language Technology Platform (LTP), standfordNLP, and the like, to perform word segmentation on a sentence, establish a dependency tree, and then input the features into a model for processing.
Based on the above research, the embodiment of the present invention provides an event statement processing method to improve the above problem.
Referring to fig. 1, the event statement processing method according to the embodiment of the present invention is applied to the electronic device 100 shown in fig. 1, and the electronic device 100 executes the event statement processing method according to the embodiment. In the embodiment, the electronic device 100 may be, but is not limited to, an electronic device 100 with a processing capability, such as a Personal Computer (PC), a notebook Computer, a Personal Digital Assistant (PDA), or a server.
The electronic device 100 includes an event sentence processing apparatus 10, a memory 20, a processor 30, and a communication unit 40; the various elements of the memory 20, processor 30 and communication unit 40 are electrically connected to each other, directly or indirectly, to enable the transfer or interaction of data. For example, the components may be directly electrically connected to each other via one or more communication buses or signal lines. The event statement processing device 10 includes at least one software functional module which can be stored in the memory 20 in the form of software or Firmware (Firmware), and the processor 30 executes various functional applications and data processing by running software programs and modules stored in the memory 20.
The Memory 20 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like.
The processor 30 may be an integrated circuit chip having signal processing capabilities. The processor 30 may be a general-purpose processor including a Central Processing Unit (CPU), a Network Processor (NP), and the like.
The communication unit 40 is configured to establish a communication connection between the electronic device 100 and another external device through a network, and perform data transmission through the network.
It is to be understood that the configuration shown in fig. 1 is merely exemplary, and that the electronic device 100 may include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
Based on the architecture diagram of the electronic device 100, please refer to fig. 2, fig. 2 is a flowchart illustrating the event statement processing method provided in this embodiment, which is executed by the electronic device shown in fig. 1, and the flowchart shown in fig. 2 is described in detail below.
Step S10: and mapping each word in the event statement to obtain a vectorization statement corresponding to the event statement.
Because electronic devices such as computers cannot directly process the chinese language, each word in the event sentence needs to be converted into a numeric mapping to obtain a vectorized representation of each word, and then the vectorized representations of each word are combined to obtain a vectorized sentence corresponding to the event sentence.
As an optional implementation manner, in this embodiment, each word in the event statement may be mapped through the word2vector model, so as to obtain a vectorization statement corresponding to the event statement. Before that, in the event statement processing method provided by this embodiment, a large amount of data is trained in advance by using a word2vector model to obtain a vector corresponding to each word, and then a vectorization statement corresponding to the event statement is obtained according to the vector corresponding to each word.
For example, given a large amount of data oneThere are 20000 different words, each with 300 dimensions, i.e. a 300-length vector is randomly initialized for each word, e.g. [0.01, 0.002, 0.0123, 0.09.. 0.023 ]]300Then a dimension of [20000, 300 ] can be obtained]To obtain a vector for each word. For the 20000 words, each word corresponds to a unique number, if "me" corresponds to the number 3, "he" corresponds to the number 4, "win" corresponds to the number 987, "has" corresponds to the number 234.. then, for a sentence "i win" the number corresponding to each word is 3, 987, 234, respectively, after obtaining the number corresponding to each word in the sentence, the vector numbered 3, the vector numbered 987, the vector numbered 234 can be found from 20000 words, and then the vector numbered 3, the vector numbered 987, and the vector numbered 234 are combined, so that the vector conversational sentence corresponding to the sentence can be obtained. As an alternative embodiment, the vector corresponding to each word can also directly adopt the trained public data, and then fine-tune the trained public data.
Step S20: and performing linear transformation on the vectorization sentences, and mapping the vectorization sentences subjected to linear transformation to a plurality of semantic spaces for processing to obtain deep vectorization sentences.
Step S30: and splicing the deep vectorization statement and the vectorization statement to obtain a spliced statement vector.
Step S40: and encoding the statement vector to obtain the encoding characteristics of the event statement.
After the vectorization statement corresponding to the event statement is obtained, the vectorization statement is subjected to linear transformation, and then the vectorization statement subjected to linear transformation is mapped to a plurality of semantic spaces for processing so as to capture relevant information of different subspaces, so that richer deep vectorization statements are obtained.
After the deep vectorization statement is obtained, the vectorization statement and the deep vectorization statement are spliced to obtain a new vector, namely, a statement vector, and the statement vector is encoded to obtain the encoding characteristic of the event statement.
Step S50: decoding the coding features of the event statement by using the trained event detection model to obtain an event main body of the event statement, and detecting the event type of the coding features of the event statement to obtain the event type of the event statement.
After the coding features of the event statements are obtained, the processing is divided into two paths, wherein one path is used for decoding the coding features of the event statements to obtain event bodies of the event statements, and the other path is used for detecting the event types of the event statements based on the coding features of the event statements to obtain the event types of the event statements, so that the extraction of the event bodies of the event statements and the detection of the event types are realized.
The event statement processing method provided by the embodiment realizes multitasking by detecting the event type of the event statement and extracting the event subject, and meanwhile, more useful information can be obtained, so that the method has a strong practical application value.
On the basis of the above, please refer to fig. 3, as an alternative embodiment, the step of mapping the linearly transformed vectorized sentences to a plurality of semantic spaces for processing to obtain the deep vectorized sentences includes steps S21 to S24.
Step S21: the linearly transformed vectorized statements are copied to multiple semantic spaces using a multi-headed self-attention mechanism.
The Multi-head self-attention mechanism (Multi-head self-attention mechanism) is to divide a result obtained by calculation into a plurality of intermediate results, and adopt the self-attention mechanism for each intermediate result, so that the result obtained by calculation is mapped to a plurality of semantic spaces to capture related information of different sub-spaces, and richer deep vectorization statements are obtained, so that a final result is more accurate.
In a specific embodiment, the event statement processing method provided in this embodiment copies the linearly transformed vectorized statement to a plurality of semantic spaces by using a multi-head self-attention mechanism, for example, the linearly transformed vectorized statement is a vector with a dimension [ B, S, D ], where B is batch _ size, S is sentence length, D is hidden layer dimension, if B is 1, the length of the event statement is 3, and D is 64, the linearly transformed vectorized statement is a vector of [3, 64], and copies the vector into N parts, that is, N semantic spaces, where N is the number of multi-heads, and is settable in a self-defined manner.
Compared with the prior art, the semantic space is divided in a limited range by adopting a dividing mode, limited feature information is extracted (for example, when a vector of [3, 512] is given, each semantic space can only be [3, 64]), the semantic space is divided by adopting a copying mode, the number of the semantic spaces can be set at will, and further, the implementation can obtain more features, capture related information of more subspaces and obtain richer deep vectorized sentences.
Step S22: and aiming at each semantic space, randomly initializing in the semantic space to obtain a target vectorization statement, and performing first matrix operation on the vectorization statement subjected to linear transformation in the semantic space and the target vectorization statement to obtain a first semantic matrix.
In this embodiment, the first matrix operation is: MGTOptionally, in this embodiment, the dimensions of the target vectorization statement and the vectorization statement after the linear transformation are the same, and the MG is a unit of a vector, where M is the vectorization statement after the linear transformation, and G is the vectorization statement obtained after the random initialization, that is, the target vectorization statementTI.e. representing the linear transformed vectorized statement multiplied by the transpose of the target vectorized statement.
For example, the linear transformed vectorized statement is [3, 64]]In the direction ofAmount, which is replicated in N portions, each portion still being [3, 64]]The vector of (2), i.e. M, in each semantic space, the target vectorization statement obtained by random initialization is G, which has the same dimension as the vectorization statement M after linear transformation, and then MG is operated by the first matrixTTo obtain a dimension of [3, 3 ]]The matrix of (2) is the first semantic matrix.
Step S23: and performing second matrix operation on the first semantic matrix and the vectorized sentences after linear transformation in the semantic space to obtain a second semantic matrix.
In this embodiment, the second matrix operation is: and HM, wherein H is the first semantic matrix, and HM represents the vectorization statement obtained by multiplying the first semantic matrix by linear transformation.
For example, the vectorized statement M after linear transformation is [3, 64]]By a first matrix operation MGTThen, the dimension of the obtained first semantic matrix H is [3, 3 ]]Through the second matrix operation HM, a new [3, 64] can be obtained]The matrix is a second semantic matrix.
Step S24: and splicing the second semantic matrix of each semantic space to obtain the deep vectorization statement.
And based on the steps, after the second semantic matrix of each semantic space is obtained, the second semantic matrix of each semantic space is spliced, and the deep vectorization statement is obtained. For example, the second semantic matrix obtained by each semantic space is [3, 64], if N is 8, that is, there are 8 semantic spaces, 8 matrices with dimensions [3, 64] can be obtained, and after the 8 matrices with dimensions [3, 64] are spliced, a matrix with dimensions [3, 512] is obtained, where the matrix with dimensions [3, 512] is the deep vectorization statement in this embodiment.
According to the embodiment, the vectorized sentences after linear transformation are mapped to the multiple semantic spaces for processing, so that the related information of different subspaces is captured, further richer deep vectorized sentences can be obtained, and the processing efficiency of subsequent work is improved.
As an alternative, referring to fig. 4, the step of encoding the sentence vector to obtain the encoding characteristic of the event sentence includes steps S41 to S42.
Step S41: and coding the statement vector according to a bidirectional long-short term memory network to obtain the output in a first direction and a second direction.
Step S42: and splicing the outputs in the first direction and the second direction to obtain the coding characteristics of the event statement.
The bidirectional Long-Term Memory network (LSTM) generally includes two general neural networks, one being a neural network in a forward direction and using past information, and the other being a neural network in a reverse direction and using future information. Therefore, the statement vector is encoded through the bidirectional long and short term memory network, and the output in two directions, namely the output in the first direction and the output in the second direction, can be obtained.
After the outputs in the first direction and the second direction are obtained, the outputs in the first direction and the second direction are spliced to obtain a final coding result, namely the coding feature of the event statement. For example, the dimensions of the output obtained through the bidirectional long and short term memory network are [ B, S, D ], where B is batch _ size, S is sentence length, D is the number of hidden nodes set in the layer, and assuming that 300 is used, the output in two directions is spliced to form a matrix with the dimensions of [ B, S, 600], and the matrix is the coding feature of the event statement.
After the coding features of the event statements are obtained, the coding features of the event statements can be input into a trained event detection model, and event bodies and event types of the event statements are obtained.
In a further embodiment, referring to fig. 5, the event detection model is trained through steps S60 to S70:
s60: and carrying out event main body marking and event type marking on each event statement in the training data set to obtain a marked event statement.
As an optional implementation, the event body of each event statement in the training data set is labeled by a BIO labeling method in this embodiment. In the BIO labeling method, B represents begin, I represents inside, i.e. middle, and O represents other. For example, if a certain event statement is "company a has funded but will not pay for the debt, and will make bankruptcy reform", where company a is the event subject of the event statement, the three words of company a are labeled as B, I in turn, I is labeled as "a" and B, I is labeled as "public" and "department" and all the words in the event statement are labeled as O.
When the event type of each event statement in the training data set is marked, the event type may be corresponding to a number, that is, one event type corresponds to one number, for example, if there are 5 event types in the event statement in the training data set, the 5 event types may be respectively marked as [0, 1, 2, 3, 4 ]. For example, a financial fraud type corresponds to the flag 5, and an event statement belongs to the financial fraud type, the event statement is marked 5.
After the event type and the event body of each event statement in the training data set are labeled, the encoding characteristics of each labeled event statement are obtained according to steps S10 to S40.
S70: and aiming at each marked event statement, inputting the coding characteristics of the marked event statement into an event detection model to be trained for training, and adjusting the parameters of the event detection model to be trained through a back propagation algorithm based on a preset loss function until the output of the preset loss function is less than a preset threshold value.
The event detection model to be trained provided by this embodiment includes a one-way long-short term memory network, a convolutional neural network, and a fully-connected network, and after obtaining the coding features of each labeled event statement, the coding features of each labeled event statement are input into the event detection model to be trained for training.
And aiming at the coding characteristics of each marked event statement, inputting the coding characteristics of the marked event statement into an event detection model to be trained, dividing the coding characteristics of the marked event statement into two paths, processing the coding characteristics of the marked event statement, detecting the event type of one path, and extracting an event main body of the other path.
Specifically, the coding features of the marked event sentence can be decoded by using a one-way long and short term memory network, and the probability that each word in the marked event sentence belongs to each mark type is output, that is, the probability that each word belongs to the mark B, the mark I and the mark O respectively is output. For each word, the output probability of the label corresponding to the maximum probability value, i.e. the label belonging to the word, is, for example, 0.5, 0.3, 0.2 for a word, where 0.5 corresponds to the B label, 0.3 corresponds to the I label, and 0.2 corresponds to the O label, then the label of the word is the B label.
And meanwhile, performing pooling operation on the coding features of the marked event statements by using a convolutional neural network, and then inputting the pooled coding features into a fully-connected network to judge the event types, wherein the output of the fully-connected network is the probability that the marked event statements belong to each event type, and the type corresponding to the maximum probability value is the event type of the marked event statements. For example, if the output of a certain marked event statement is 0.3 for the event type 0, 0.1 for the event type 1, 0.4 for the event type 2, 0.15 for the event type 3, and 0.05 for the event type 4, the marked event statement is the event type 2.
After calculating the event type of the event sentence with the output mark and the mark of each word in the event sentence, comparing the calculated and output event type with the event type of each word marked in the event sentence with the mark in the training data set after the mark is output to obtain a first error, comparing the mark of each word with the mark of each word in the event sentence with the mark in the training data set after the mark is output to obtain a second error, accumulating the first error and the second error to obtain a total error, reversely propagating the total error through a back propagation algorithm based on a preset loss function, adjusting the parameters of the event detection model to be trained until the output of the preset loss function is smaller than a preset threshold value, and finishing the training of the event detection model.
After the trained event detection model is obtained, the coding features of the event sentence to be processed are obtained for the event sentence to be processed, and then the coding features of the event sentence can be input into the trained event detection model for processing. Specifically, referring to fig. 6 and 7 in combination, the step of decoding the encoding characteristic of the event statement to obtain the event body of the event statement includes steps S51 to S52. The step of detecting the event type of the event statement to obtain the event type of the event statement includes steps S53 to S55.
Step S51: and decoding the coding characteristics of the event sentence by using the one-way long and short term memory network to obtain the probability that each word in the event sentence belongs to the event subject.
Step S52: and obtaining the event main body of the event sentence according to the probability that each word in the event sentence belongs to the event main body.
After the coding features of the event sentences are input into a trained event detection model, the coding features of the event sentences can be decoded through a one-way long-term and short-term memory network, the probability that each word in the event sentences belongs to each mark can be obtained, the mark B is used as the beginning, the mark I is used as the end, the word with the maximum probability value of the mark B in the three marks is selected, then the word with the maximum probability value of the mark I in the three marks is selected, and the selected words are combined to be used as the event main body of the event sentences, namely the words are selected in the format of B _ I _ I.
For example, after the coding feature of an event statement "company A has paid up and will carry out bankruptcy reformation" is input into a trained event detection model, the probabilities that "A" belongs to each mark are respectively 0.5, 0.3 and 0.2, and "A" is obtained as a B mark; the probabilities that the 'public' belongs to each mark are respectively 0.3, 0.4 and 0.3, and the 'public' is obtained as an I mark; the probability that the output's' belongs to each mark is 0.2, 0.5 and 0.3 respectively, and the's' is the mark I; the probabilities that the 'already' belongs to each mark are respectively 0.3, 0.1 and 0.6, and the 'already' is an O mark; the probability that the output 'warp' belongs to each mark is 0.1, 0.1 and 0.8 respectively, and the result that the 'warp' is an O mark.
For another example, after the coding feature of a certain event statement "the company a is not eligible to perform bankruptcy reformation this year" is input into the trained event detection model, the probabilities that "present" belongs to each mark are respectively 0.5, 0.3 and 0.2, and "present" is obtained as a mark B; the probability that the output 'year' belongs to each mark is 0.2, 0.1 and 0.7 respectively, and the 'year' is obtained as an O mark; the probabilities that the output 'A' belongs to each mark are respectively 0.5, 0.3 and 0.2, and the 'A' is obtained as a B mark; the probabilities that the 'public' belongs to each mark are respectively 0.3, 0.4 and 0.3, and the 'public' is obtained as an I mark; the probability that the output's' belongs to each mark is 0.2, 0.5 and 0.3 respectively, and the's' is the mark I; the probability that the output 'already' belongs to each mark is 0.3, 0.1 and 0.6 respectively, and the result shows that the 'already' is an O mark.
Step S53: and performing pooling operation on the coding features of the event statements according to the convolutional neural network to obtain the coding features after the pooling operation.
Step S54: and inputting the coding features after the pooling operation into the full-connection network to obtain the probability that the event statement belongs to each event type.
Step S55: and obtaining the event type of the event statement according to the probability that the event statement belongs to each event type.
After the coding features of the event statements are input into a trained event detection model, pooling operation is carried out on the coding features of the event statements through a convolutional neural network, then the coding features after the pooling operation are input into a full-connection network to judge event types, the output of the full-connection network is the probability that the event statements belong to each event type, and the category corresponding to the maximum probability value is selected as the event type of the event statements.
In the event statement processing method provided in this embodiment, after the coding features of the event statement are obtained, the coding features of the event statement are input into a trained event detection model for processing, so that the event body and the event type of the event statement can be quickly and accurately obtained, for example, the coding features of "mingmen suspected financial fraud" of a certain event statement are input into the event detection model, so that the event body of the event statement can be output as mingmen, and the event type is financial fraud.
On the basis, please refer to fig. 8, the embodiment further provides an event statement processing apparatus 10, where the event statement processing apparatus 10 includes a mapping module 11, a splicing module 12, an encoding module 13, and a processing module 14.
The mapping module 11 is configured to map each word in an event statement to obtain a vectorization statement corresponding to the event statement, perform linear transformation on the vectorization statement, and map the vectorization statement after the linear transformation to a plurality of semantic spaces for processing to obtain a deep vectorization statement.
The splicing module 12 is configured to splice the deep vectorization statement and the vectorization statement to obtain a spliced statement vector.
The encoding module 13 is configured to encode the statement vector to obtain an encoding characteristic of the event statement.
The processing module 14 is configured to decode the coding features of the event statement by using the trained event detection model to obtain an event body of the event statement, and detect the event type of the coding features of the event statement to obtain the event type of the event statement.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the event statement processing apparatus 10 described above may refer to the corresponding process in the foregoing method, and will not be described in too much detail herein.
On the basis, the embodiment further provides a computer device, which includes a processor and a nonvolatile memory storing computer instructions, where the computer instructions are executed by the processor, and the computer device performs the event statement processing method described above.
On the basis, the embodiment further provides a readable storage medium, where the readable storage medium includes a computer program, and the computer program controls, when running, a computer device on which the readable storage medium is located to execute the event statement processing method.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the computer device and the readable storage medium described above may refer to the corresponding processes in the foregoing method, and will not be described in detail herein.
To sum up, the method, the apparatus, the computer device and the readable storage medium for processing an event statement according to embodiments of the present invention map each word in an event statement to obtain a vectorized statement corresponding to the event statement, perform linear transformation on the vectorized statement, map the vectorized statement after the linear transformation to a plurality of semantic spaces for processing to obtain a deep vectorized statement, splice the deep vectorized statement and the vectorized statement to obtain a spliced statement vector, encode the statement vector to obtain an encoding feature of the event statement, decode the encoding feature of the event statement by using an event detection model obtained by training to obtain an event body of the event statement, detect an event type of the encoding feature of the event statement to obtain an event type of the event statement, and further, the detection of the event type of the event statement and the extraction of the event main body of the event statement are realized, and the method has a strong practical application value.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (10)

1. An event statement processing method, comprising:
mapping each word in an event statement to obtain a vectorization statement corresponding to the event statement;
performing linear transformation on the vectorization sentences, and mapping the vectorization sentences after the linear transformation to a plurality of semantic spaces for processing to obtain deep vectorization sentences;
splicing the deep vectorization statement and the vectorization statement to obtain a spliced statement vector;
encoding the statement vector to obtain the encoding characteristics of the event statement;
decoding the coding features of the event statement by using the trained event detection model to obtain an event main body of the event statement, and detecting the event type of the coding features of the event statement to obtain the event type of the event statement.
2. The method for processing event sentences according to claim 1, wherein the step of mapping the linearly transformed vectorized sentences to a plurality of semantic spaces for processing to obtain deep vectorized sentences comprises:
copying the vectorized sentences after the linear transformation to a plurality of semantic spaces by using a multi-head self-attention mechanism;
aiming at each semantic space, randomly initializing in the semantic space to obtain a target vectorization statement, and performing first matrix operation on the vectorization statement subjected to linear transformation in the semantic space and the target vectorization statement to obtain a first semantic matrix;
performing second matrix operation on the first semantic matrix and the vectorized sentences after linear transformation in the semantic space to obtain a second semantic matrix;
and splicing the second semantic matrix of each semantic space to obtain the deep vectorization statement.
3. The method according to claim 1, wherein the step of encoding the sentence vector to obtain the encoding characteristic of the event sentence comprises:
coding the statement vector according to a bidirectional long and short term memory network to obtain the output in a first direction and a second direction;
and splicing the outputs in the first direction and the second direction to obtain the coding characteristics of the event statement.
4. The event statement processing method according to claim 1, wherein the event detection model includes a one-way long-short term memory network;
the step of decoding the coding features of the event statement to obtain the event body of the event statement comprises:
decoding the coding features of the event sentences by using the one-way long and short term memory network to obtain the probability that each word in the event sentences belongs to the event subject;
and obtaining the event main body of the event sentence according to the probability that each word in the event sentence belongs to the event main body.
5. The event statement processing method according to claim 1, characterized in that the event detection model further comprises a convolutional neural network and a fully-connected network;
the step of detecting the event type of the coding feature of the event statement to obtain the event type of the event statement comprises:
performing pooling operation on the coding features of the event statements according to the convolutional neural network to obtain the coding features after the pooling operation;
inputting the coding features after the pooling operation into the full-connection network to obtain the probability that the event statement belongs to each event type;
and obtaining the event type of the event statement according to the probability that the event statement belongs to each event type.
6. The event statement processing method according to claim 1, wherein the event detection model is trained by:
carrying out event main body marking and event type marking on each event statement in the training data set to obtain a marked event statement;
and aiming at each marked event statement, inputting the coding characteristics of the marked event statement into an event detection model to be trained for training, and adjusting the parameters of the event detection model to be trained through a back propagation algorithm based on a preset loss function until the output of the preset loss function is less than a preset threshold value.
7. The event statement processing method according to claim 6, wherein the event body labeling of each event statement in the training data set is implemented by a BIO labeling method.
8. An event statement processing device is characterized by comprising a mapping module, a splicing module, a coding module and a processing module;
the mapping module is used for mapping each word in an event statement to obtain a vectorization statement corresponding to the event statement, performing linear transformation on the vectorization statement, and mapping the vectorization statement after the linear transformation to a plurality of semantic spaces for processing to obtain a deep vectorization statement;
the splicing module is used for splicing the deep vectorization statement and the vectorization statement to obtain a spliced statement vector;
the coding module is used for coding the statement vector to obtain the coding characteristics of the event statement;
the processing module is used for decoding the coding features of the event statements by using the trained event detection model to obtain event main bodies of the event statements, and detecting the event types of the coding features of the event statements to obtain the event types of the event statements.
9. A computer device comprising a processor and a non-volatile memory storing computer instructions, wherein when the computer instructions are executed by the processor, the computer device performs the event statement processing method according to any one of claims 1 to 7.
10. A readable storage medium, characterized in that the readable storage medium comprises a computer program, and the computer program controls a computer device on which the readable storage medium is executed to execute the event statement processing method according to any one of claims 1 to 7.
CN201910948382.3A 2019-09-30 2019-09-30 Event statement processing method and device, computer equipment and readable storage medium Active CN110674303B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910948382.3A CN110674303B (en) 2019-09-30 2019-09-30 Event statement processing method and device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910948382.3A CN110674303B (en) 2019-09-30 2019-09-30 Event statement processing method and device, computer equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN110674303A true CN110674303A (en) 2020-01-10
CN110674303B CN110674303B (en) 2022-03-01

Family

ID=69080639

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910948382.3A Active CN110674303B (en) 2019-09-30 2019-09-30 Event statement processing method and device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN110674303B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111368551A (en) * 2020-02-14 2020-07-03 京东数字科技控股有限公司 Method and device for determining event subject
CN111814640A (en) * 2020-06-30 2020-10-23 北京玩在一起科技有限公司 Method and system for detecting live event of electric competition and extracting information
CN112036168A (en) * 2020-09-02 2020-12-04 深圳前海微众银行股份有限公司 Event subject recognition model optimization method, device and equipment and readable storage medium
CN113761132A (en) * 2021-09-09 2021-12-07 上海明略人工智能(集团)有限公司 Event detection method, system, electronic equipment and storage medium
CN114462418A (en) * 2021-12-31 2022-05-10 粤港澳大湾区数字经济研究院(福田) Event detection method, system, intelligent terminal and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120278336A1 (en) * 2011-04-29 2012-11-01 Malik Hassan H Representing information from documents
CN107122416A (en) * 2017-03-31 2017-09-01 北京大学 A kind of Chinese event abstracting method
CN107239445A (en) * 2017-05-27 2017-10-10 中国矿业大学 The method and system that a kind of media event based on neutral net is extracted
CN108628823A (en) * 2018-03-14 2018-10-09 中山大学 In conjunction with the name entity recognition method of attention mechanism and multitask coordinated training
CN110134757A (en) * 2019-04-19 2019-08-16 杭州电子科技大学 A kind of event argument roles abstracting method based on bull attention mechanism
CN110209807A (en) * 2018-07-03 2019-09-06 腾讯科技(深圳)有限公司 A kind of method of event recognition, the method for model training, equipment and storage medium
CN110209816A (en) * 2019-05-24 2019-09-06 中国科学院自动化研究所 Event recognition and classification method, system, device based on confrontation learning by imitation

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120278336A1 (en) * 2011-04-29 2012-11-01 Malik Hassan H Representing information from documents
CN107122416A (en) * 2017-03-31 2017-09-01 北京大学 A kind of Chinese event abstracting method
CN107239445A (en) * 2017-05-27 2017-10-10 中国矿业大学 The method and system that a kind of media event based on neutral net is extracted
CN108628823A (en) * 2018-03-14 2018-10-09 中山大学 In conjunction with the name entity recognition method of attention mechanism and multitask coordinated training
CN110209807A (en) * 2018-07-03 2019-09-06 腾讯科技(深圳)有限公司 A kind of method of event recognition, the method for model training, equipment and storage medium
CN110134757A (en) * 2019-04-19 2019-08-16 杭州电子科技大学 A kind of event argument roles abstracting method based on bull attention mechanism
CN110209816A (en) * 2019-05-24 2019-09-06 中国科学院自动化研究所 Event recognition and classification method, system, device based on confrontation learning by imitation

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111368551A (en) * 2020-02-14 2020-07-03 京东数字科技控股有限公司 Method and device for determining event subject
CN111368551B (en) * 2020-02-14 2023-12-05 京东科技控股股份有限公司 Method and device for determining event main body
CN111814640A (en) * 2020-06-30 2020-10-23 北京玩在一起科技有限公司 Method and system for detecting live event of electric competition and extracting information
CN112036168A (en) * 2020-09-02 2020-12-04 深圳前海微众银行股份有限公司 Event subject recognition model optimization method, device and equipment and readable storage medium
WO2022048194A1 (en) * 2020-09-02 2022-03-10 深圳前海微众银行股份有限公司 Method, apparatus and device for optimizing event subject identification model, and readable storage medium
CN112036168B (en) * 2020-09-02 2023-04-25 深圳前海微众银行股份有限公司 Event main body recognition model optimization method, device, equipment and readable storage medium
CN113761132A (en) * 2021-09-09 2021-12-07 上海明略人工智能(集团)有限公司 Event detection method, system, electronic equipment and storage medium
CN113761132B (en) * 2021-09-09 2024-03-19 上海明略人工智能(集团)有限公司 Event detection method, system, electronic equipment and storage medium
CN114462418A (en) * 2021-12-31 2022-05-10 粤港澳大湾区数字经济研究院(福田) Event detection method, system, intelligent terminal and computer readable storage medium
CN114462418B (en) * 2021-12-31 2023-04-07 粤港澳大湾区数字经济研究院(福田) Event detection method, system, intelligent terminal and computer readable storage medium

Also Published As

Publication number Publication date
CN110674303B (en) 2022-03-01

Similar Documents

Publication Publication Date Title
CN110674303B (en) Event statement processing method and device, computer equipment and readable storage medium
CN112464641B (en) BERT-based machine reading understanding method, device, equipment and storage medium
CN114372477B (en) Training method of text recognition model, and text recognition method and device
JP6955580B2 (en) Document summary automatic extraction method, equipment, computer equipment and storage media
CN111241304B (en) Answer generation method based on deep learning, electronic device and readable storage medium
CN111475617B (en) Event body extraction method and device and storage medium
CN114218403B (en) Fault root cause positioning method, device, equipment and medium based on knowledge graph
CN113486178B (en) Text recognition model training method, text recognition method, device and medium
CN112686049A (en) Text auditing method, device, equipment and storage medium
CN113688631A (en) Nested named entity recognition method, system, computer and storage medium
CN111091004A (en) Training method and training device for sentence entity labeling model and electronic equipment
CN113239702A (en) Intention recognition method and device and electronic equipment
CN111428757A (en) Model training method, abnormal data detection method and device and electronic equipment
CN112085091A (en) Artificial intelligence-based short text matching method, device, equipment and storage medium
CN115544560A (en) Desensitization method and device for sensitive information, computer equipment and storage medium
CN112949320B (en) Sequence labeling method, device, equipment and medium based on conditional random field
CN117807482B (en) Method, device, equipment and storage medium for classifying customs clearance notes
CN111126056B (en) Method and device for identifying trigger words
CN116089605A (en) Text emotion analysis method based on transfer learning and improved word bag model
CN115270792A (en) Medical entity identification method and device
CN113326698A (en) Method for detecting entity relationship, model training method and electronic equipment
CN112417886A (en) Intention entity information extraction method and device, computer equipment and storage medium
CN112860919B (en) Data labeling method, device, equipment and storage medium based on generation model
CN114462411B (en) Named entity recognition method, device, equipment and storage medium
CN113515931B (en) Text error correction method, device, computer equipment and storage medium

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220615

Address after: 15, second floor, east side of clean coal workshop, No. 68, Shijingshan Road, Shijingshan District, Beijing 100043 (cluster registration)

Patentee after: Beijing Zhizhi Heshu Technology Co.,Ltd.

Address before: No.310, building 4, courtyard 8, Dongbei Wangxi Road, Haidian District, Beijing

Patentee before: MININGLAMP SOFTWARE SYSTEMS Co.,Ltd.