CN111104477A - Event confirmation method and device and electronic equipment - Google Patents

Event confirmation method and device and electronic equipment Download PDF

Info

Publication number
CN111104477A
CN111104477A CN201811282309.9A CN201811282309A CN111104477A CN 111104477 A CN111104477 A CN 111104477A CN 201811282309 A CN201811282309 A CN 201811282309A CN 111104477 A CN111104477 A CN 111104477A
Authority
CN
China
Prior art keywords
word
event
event type
vector
network
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
CN201811282309.9A
Other languages
Chinese (zh)
Other versions
CN111104477B (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201811282309.9A priority Critical patent/CN111104477B/en
Publication of CN111104477A publication Critical patent/CN111104477A/en
Application granted granted Critical
Publication of CN111104477B publication Critical patent/CN111104477B/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/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Abstract

The application discloses an event confirmation method and device, an event type prediction model construction method and device and electronic equipment. The event confirmation method comprises the following steps: acquiring words to be detected in an article and sentence fragments corresponding to the words to be detected; taking word vectors related to the articles, word vectors related to sentence fragments and word position vectors of words in the sentence fragments as input data of an event type prediction model, extracting sub-networks through article-level event characteristics, extracting article-level event characteristics according to the word vectors related to the articles, extracting sub-networks through context-level event characteristics, and extracting context-level event characteristics according to the word vectors and the word position vectors related to the sentence fragments; and predicting the event type of the word to be detected through the event type prediction sub-network according to the article level and context level event characteristics. By adopting the processing mode, the event recognition is carried out by combining the information of the article where the word to be detected is located and the information of the peripheral text; therefore, the accuracy of event identification can be effectively improved.

Description

Event confirmation method and device and electronic equipment
Technical Field
The application relates to the technical field of natural language processing, in particular to an event confirmation method and device, an event type prediction model construction method and device and electronic equipment.
Background
An event extraction (event extraction) technology is a research hotspot in the field of natural language, and can automatically detect a preset event from an article.
The process of a typical event confirmation method is as follows. Firstly, acquiring text data with labeled event types as training data; then, learning from the training data through a machine learning algorithm to obtain an event type prediction model; and finally, the text to be detected is used as input data of an event type prediction model, and the event included in the text is automatically identified through the model.
However, in the process of implementing the present invention, the inventor finds that the prior art solution has at least the following problems: the accuracy of event recognition is low because information is simply extracted from a limited text range around the word to be detected, and the information of the whole chapter is ignored.
Disclosure of Invention
The application provides an event confirmation method, which aims to solve the problem of low event identification accuracy in the prior art. The application further provides an event confirmation device, an event type prediction model construction method and device and electronic equipment.
The application provides an event confirmation method, which comprises the following steps:
acquiring words to be detected in an article; acquiring sentence fragments corresponding to the words to be detected;
performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
taking the first word vector, the second word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises an article level event feature extraction sub-network, a context level event feature extraction sub-network and an event type prediction sub-network;
extracting the article-level event features according to the first word vector through the article-level event feature extraction sub-network, extracting the context-level event features according to the second word vector and the word position vector through the context-level event feature extraction sub-network;
and acquiring a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the article-level event characteristics and the upper and lower context-level event characteristics through the event type prediction sub-network.
Optionally, the method further includes:
acquiring event types respectively corresponding to at least one word appearing before or after the word to be detected as event types of adjacent words;
executing event type vector embedding on the event types of the adjacent words to obtain event type vectors;
the predicting the sub-network according to the event type, and obtaining the predicted value of the event type corresponding to the word to be detected at least according to the article-level event feature and the context-level event feature includes:
and acquiring the predicted value according to the article-level event feature, the context-level event feature and the event type vector through the event type prediction sub-network.
Optionally, the article-level event feature extraction sub-network includes: sentence-level event characteristics determine a sub-network, paragraph-level event type characteristics determine a sub-network, and article-level event characteristics determine a sub-network;
the extracting the sub-network through the article-level event features and extracting the article-level event features according to the first word vector comprises the following steps:
determining a sub-network through the sentence-level event characteristics, and acquiring sentence-level event characteristics corresponding to sentences included in the text according to the first word vector;
determining a sub network through the paragraph-level event type features, and acquiring paragraph-level event type features corresponding to paragraphs included in the article according to sentence-level event features corresponding to sentences included in the article;
and determining a sub-network through the article-level event characteristics, and acquiring the article-level event characteristics according to the paragraph-level event type characteristics.
Optionally, the network structure of the sentence-level event feature determination sub-network comprises a Bi-directional long-short term memory network structure Bi-LSTM;
determining a sub-network through the sentence-level event characteristics, and acquiring sentence-level event characteristics corresponding to sentences included in the article according to the first word vector, wherein the sentence-level event characteristics include:
taking the forward sequence of the first word vector related to the sentence as input data of a first LSTM, and acquiring forward sentence-level event characteristics of the sentence through the first LSTM; and taking the reverse sequence of the first word vector related to the sentence as input data of a second LSTM, and acquiring reverse sentence-level event characteristics of the sentence through the second LSTM;
and obtaining sentence-level event characteristics corresponding to sentences included in the article according to the forward sentence-level event characteristics and the reverse sentence-level event characteristics.
Optionally, the sentence-level event feature determination sub-network further comprises an attention layer;
the obtaining sentence-level event features corresponding to sentences included in the article according to the forward sentence-level event features and the reverse sentence-level event features includes:
and acquiring sentence-level event characteristics corresponding to sentences included in the article according to the forward sentence-level event characteristics and the reverse sentence-level event characteristics through the attention layer.
Optionally, the context-level event feature extraction sub-network is based on a convolutional neural network structure.
Optionally, the method further includes:
learning from a training sample set to obtain the event type prediction model;
the training samples comprise articles and sentence fragments corresponding to the words to be detected for training, and the corresponding relation between word position information corresponding to the words in the sentence fragments and event types.
Optionally, the method further includes:
acquiring event types respectively corresponding to at least one word appearing before or after the word to be detected for training, and taking the event types as event types of adjacent words for training;
the learning from the training sample set to obtain the event type prediction sub-network comprises:
and learning to obtain the event type prediction model according to the training sample set and the event types of the training adjacent words corresponding to the training words to be detected.
The application also provides an event confirmation method, which comprises the following steps:
acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before the word to be detected as event types of a first adjacent word; acquiring event types respectively corresponding to at least one word appearing after the word to be detected as event types of a second adjacent word; acquiring sentence fragments corresponding to the words to be detected;
performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; performing word position vector embedding on word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network;
extracting the article-level event features according to the first word vector through the article-level event feature extraction sub-network, extracting the context-level event features according to the second word vector and the word position vector through the context-level event feature extraction sub-network;
acquiring first probabilities of various event types corresponding to the words to be detected at least according to the article-level event features, the context-level event features and the first event type vectors through the first event type prediction subnetwork; and obtaining a second probability of each event type corresponding to the word to be detected through the second event type prediction subnetwork at least according to the article-level event characteristics, the context-level event characteristics and the second event type vector;
and determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to at least the first probability and the second probability through the third event type prediction subnetwork.
The application also provides an event confirmation method, which comprises the following steps:
acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before the word to be detected as event types of a first adjacent word; acquiring event types respectively corresponding to at least one word appearing after the word to be detected as event types of a second adjacent word; acquiring sentence fragments corresponding to the words to be detected;
executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
taking the first event type vector, the second event type vector, the word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises a context level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network;
extracting a sub-network through the context-level event characteristics, and extracting the context-level event characteristics according to the word vectors and the word position vectors corresponding to the words in the sentence fragments;
acquiring a first probability of the word to be detected corresponding to various event types according to the context level event characteristics and the first event type vector through the first event type prediction subnetwork; acquiring a second probability of the word to be detected corresponding to each event type according to the context level event characteristics and the second event type vector through the second event type prediction sub-network;
and determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to at least the first probability and the second probability through the third event type prediction subnetwork.
The application also provides an event confirmation method, which comprises the following steps:
acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before or after the word to be detected as event types of adjacent words; acquiring sentence fragments corresponding to the words to be detected;
executing event type vector embedding on the event types of the adjacent words to obtain event type vectors; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
taking the event type vector, the word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises a context-level event feature extraction sub-network and an event type prediction sub-network;
extracting a sub-network through the context-level event characteristics, and extracting the context-level event characteristics according to the word vectors and the word position vectors corresponding to the words in the sentence fragments;
and acquiring a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the event type prediction sub-network and at least the context level event characteristics and the event type vector.
The application also provides an event type prediction model construction method, which comprises the following steps:
acquiring a training sample set; the training sample comprises an article corresponding to a word to be detected for training, sentence fragments, and a corresponding relation between word position information of the word in the sentence fragment and an event type;
constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the article level event characteristics and the context level event characteristics;
performing word vector embedding on the article to obtain the first word vector; performing word vector embedding on the sentence fragments to obtain a second word vector; performing word position vector embedding on the word position information to obtain the word position vector;
and taking the first word vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
Optionally, the method further includes:
acquiring event types respectively corresponding to at least one word appearing before or after the word to be detected as event types of adjacent words;
executing event type vector embedding on the event types of the adjacent words to obtain event type vectors;
the event type prediction sub-network is specifically configured to obtain the predicted value according to the article-level event feature, the upper-level event feature, the lower-level event feature and the event type vector;
the input data to the deep neural network further includes the event type vector.
The application also provides an event type prediction model construction method, which comprises the following steps:
acquiring a training sample set; the training sample comprises an article corresponding to a word to be detected for training, sentence fragments, word position information of words in the sentence fragments, an event type of a first adjacent word, and a corresponding relation between an event type of a second adjacent word and the event type of the word to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected;
constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; the chapter-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction sub-network is used for acquiring first probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and a first event type vector corresponding to the event type of the first adjacent word; the second event type prediction subnetwork is used for acquiring second probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and a second event type vector corresponding to the event types of the second adjacent words; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability;
performing word vector embedding on the article to obtain the first word vector; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain a second word vector; performing word position vector embedding on the word position information to obtain the word position vector;
and taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
The application also provides an event type prediction model construction method, which comprises the following steps:
acquiring a training sample set; the training sample comprises sentence fragments corresponding to the training words to be detected, word position information of words in the sentence fragments, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the words to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected;
constructing a deep neural network according to a plurality of event types to be predicted; wherein the deep neural network comprises a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network, and a third event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction subnetwork is used for acquiring first probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and the first event type vectors corresponding to the event types of the first adjacent words; the second event type prediction subnetwork is used for acquiring second probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and second event type vectors corresponding to the event types of the second adjacent words; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability;
executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain the word vectors; performing word position vector embedding on the word position information to obtain the word position vector;
and taking the first event type vector, the second event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
The application also provides an event type prediction model construction method, which comprises the following steps:
acquiring a training sample set; the training sample comprises sentence fragments corresponding to the training words to be detected, word position information of words in the sentence fragments, and corresponding relations between event types of adjacent words and the event types of the words to be detected; the adjacent words comprise at least one word appearing before or after the word to be detected;
constructing a deep neural network according to a plurality of event types to be predicted; wherein the deep neural network comprises a context level event feature extraction sub-network and an event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the context level event characteristics and the event type vector corresponding to the event type of the adjacent word;
executing event type vector embedding on the event types of the adjacent words to obtain the event type vector; performing word vector embedding on the sentence fragments to obtain the word vectors; performing word position vector embedding on the word position information to obtain the word position vector;
and taking the event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
The present application also provides an event confirmation apparatus, including:
the device comprises a to-be-detected word acquisition unit, a to-be-detected word acquisition unit and a to-be-detected word acquisition unit, wherein the to-be-detected word acquisition unit is used for acquiring to-be-detected words in an article;
a sentence fragment acquisition unit for acquiring a sentence fragment corresponding to the word to be detected;
the first word embedding unit is used for executing word vector embedding on the article to obtain a word vector related to the article as a first word vector;
a second word embedding unit, configured to perform word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors;
a word position vector embedding unit, configured to perform word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
a model input unit configured to use the first word vector, the second word vector, and the word position vector as input data of an event type prediction model, where the event type prediction model includes an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, and an event type prediction sub-network;
a first feature extraction unit, configured to extract a sub-network according to the article-level event features and extract article-level event features according to the first word vector;
a second feature extraction unit, configured to extract a context-level event feature according to the second word vector and the word position vector by using the context-level event feature extraction sub-network;
and the event type prediction unit is used for acquiring a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the event type prediction sub-network and at least the chapter level event characteristic and the context level event characteristic.
The present application also provides an event confirmation apparatus, including:
the device comprises a to-be-detected word acquisition unit, a to-be-detected word acquisition unit and a to-be-detected word acquisition unit, wherein the to-be-detected word acquisition unit is used for acquiring to-be-detected words in an article;
a sentence fragment acquisition unit for acquiring a sentence fragment corresponding to the word to be detected;
a first event type obtaining unit, configured to obtain event types respectively corresponding to at least one word appearing before the word to be detected, as event types of a first adjacent word;
a second event type obtaining unit, configured to obtain event types corresponding to at least one word appearing after the word to be detected, as event types of a second adjacent word;
the first word embedding unit is used for executing word vector embedding on the article to obtain a word vector related to the article as a first word vector;
a second word embedding unit, configured to perform word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors;
a word position vector embedding unit, configured to perform word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
a first event type vector embedding unit, configured to perform event type vector embedding on the event type of the first neighboring word to obtain a first event type vector;
a second event type vector embedding unit, configured to perform event type vector embedding on the event type of the second neighboring word to obtain a second event type vector;
a model input unit, configured to use the first word vector, the first event type vector, the second word vector, and the word position vector as input data of an event type prediction model, where the event type prediction model includes an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network, and a third event type prediction sub-network;
a first feature extraction unit, configured to extract a sub-network according to the article-level event features and extract article-level event features according to the first word vector;
a second feature extraction unit, configured to extract a context-level event feature according to the second word vector and the word position vector by using the context-level event feature extraction sub-network;
a first event type prediction unit, configured to obtain, through the first event type prediction sub-network, first probabilities of various event types corresponding to the words to be detected at least according to the article-level event features, the context-level event features, and the first event type vector;
a second event type prediction unit, configured to obtain, through the second event type prediction subnetwork, a second probability of each event type corresponding to the word to be detected at least according to the article-level event feature, the context-level event feature, and the second event type vector;
and the event type determining unit is used for determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the third event type prediction sub-network and at least the first probability and the second probability.
The present application also provides an event confirmation apparatus, including:
the device comprises a to-be-detected word acquisition unit, a to-be-detected word acquisition unit and a to-be-detected word acquisition unit, wherein the to-be-detected word acquisition unit is used for acquiring to-be-detected words in an article;
a sentence fragment acquisition unit for acquiring a sentence fragment corresponding to the word to be detected;
a first event type obtaining unit, configured to obtain event types respectively corresponding to at least one word appearing before the word to be detected, as event types of a first adjacent word;
a second event type obtaining unit, configured to obtain event types corresponding to at least one word appearing after the word to be detected, as event types of a second adjacent word;
a first event type vector embedding unit, configured to perform event type vector embedding on the event type of the first neighboring word to obtain a first event type vector;
a second event type vector embedding unit, configured to perform event type vector embedding on the event type of the second neighboring word to obtain a second event type vector;
the word embedding unit is used for executing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments;
a word position vector embedding unit, configured to perform word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
a model input unit, configured to use the first event type vector, the second event type vector, the word vector, and the word position vector as input data of an event type prediction model, where the event type prediction model includes a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network, and a third event type prediction sub-network;
a feature extraction unit, configured to extract a sub-network through the context-level event features, and extract context-level event features according to the word vectors and the word position vectors corresponding to the words in the sentence fragments;
a first event type prediction unit, configured to obtain, through the first event type prediction subnetwork, first probabilities of various event types corresponding to the to-be-detected word at least according to the context-level event features and the first event type vector;
a second event type prediction unit, configured to obtain, by using the second event type prediction subnetwork, a second probability that the word to be detected corresponds to each event type at least according to the context-level event feature and the second event type vector;
and the event type determining unit is used for determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the third event type prediction sub-network and at least the first probability and the second probability.
The present application also provides an event confirmation apparatus, including:
the device comprises a to-be-detected word acquisition unit, a to-be-detected word acquisition unit and a to-be-detected word acquisition unit, wherein the to-be-detected word acquisition unit is used for acquiring to-be-detected words in an article;
a sentence fragment acquisition unit for acquiring a sentence fragment corresponding to the word to be detected;
the event type acquiring unit is used for acquiring event types corresponding to at least one word appearing before or after the word to be detected as the event types of adjacent words;
the event type vector embedding unit is used for executing event type vector embedding on the event types of the adjacent words to obtain event type vectors;
the word embedding unit is used for executing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments;
a word position vector embedding unit, configured to perform word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
a model input unit configured to use the event type vector, the word vector, and the word position vector as input data of an event type prediction model, where the event type prediction model includes a context-level event feature extraction sub-network and an event type prediction sub-network;
a feature extraction unit, configured to extract a sub-network through the context-level event features, and extract context-level event features according to the word vectors and the word position vectors corresponding to the words in the sentence fragments;
and the event type prediction unit is used for acquiring a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the event type prediction sub-network and at least the context level event characteristics and the event type vector.
The present application further provides an event type prediction model construction device, including:
a training sample acquisition unit for acquiring a training sample set; the training sample comprises an article corresponding to the to-be-detected words for training, sentence fragments, and a corresponding relation between word position information of the words in the sentence fragments and event types;
the network construction unit is used for constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the article-level event characteristics and the context-level event characteristics;
the first word embedding unit is used for executing word vector embedding on the article to obtain a first word vector;
the second word embedding unit is used for executing word vector embedding on the sentence fragments to obtain a second word vector;
a word position vector embedding unit configured to perform word position vector embedding on the word position information to obtain the word position vector;
and the model training unit is used for taking the first word vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
The present application further provides an event type prediction model construction device, including:
a training sample acquisition unit for acquiring a training sample set; the training sample comprises an article corresponding to a word to be detected for training, sentence fragments, word position information of words in the sentence fragments, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the word to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected;
the network construction unit is used for constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction sub-network is used for acquiring first probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and a first event type vector corresponding to the event types of the first adjacent words; the second event type prediction subnetwork is used for acquiring second probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and a second event type vector corresponding to the event types of the second adjacent words; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability;
the first word embedding unit is used for executing word vector embedding on the article to obtain a first word vector;
a first event type vector embedding unit, configured to perform event type vector embedding on the event type of the first neighboring word to obtain a first event type vector;
a second event type vector embedding unit, configured to perform event type vector embedding on the event type of the second neighboring word to obtain a second event type vector;
the second word embedding unit is used for executing word vector embedding on the sentence fragments to obtain a second word vector;
a word position vector embedding unit configured to perform word position vector embedding on the word position information to obtain the word position vector;
and the model training unit is used for taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
The present application further provides an event type prediction model construction device, including:
a training sample acquisition unit for acquiring a training sample set; the training sample comprises a sentence fragment corresponding to a word to be detected for training, word position information of words in the sentence fragment, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the word to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected;
the network construction unit is used for constructing a deep neural network according to a plurality of event types to be predicted; wherein the deep neural network comprises a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and word position vectors corresponding to the word position information; the first event type prediction subnetwork is used for acquiring first probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and the first event type vectors corresponding to the event types of the first adjacent words; the second event type prediction sub-network is used for acquiring second probabilities of various event types corresponding to the words to be detected according to the context level event characteristics and a second event type vector corresponding to the event type of the second adjacent word; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability;
a first event type vector embedding unit, configured to perform event type vector embedding on the event type of the first neighboring word to obtain a first event type vector;
a second event type vector embedding unit, configured to perform event type vector embedding on the event type of the second neighboring word to obtain a second event type vector;
the word embedding unit is used for executing word vector embedding on the sentence fragments to obtain the word vectors;
a word position vector embedding unit configured to perform word position vector embedding on the word position information to obtain the word position vector;
and the model training unit is used for taking the first event type vector, the second event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
The present application further provides an event type prediction model construction device, including:
a training sample acquisition unit for acquiring a training sample set; the training sample comprises sentence fragments corresponding to the words to be detected for training, word position information of words in the sentence fragments, and corresponding relations between event types of adjacent words and the event types of the words to be detected; the adjacent words comprise at least one word appearing before or after the word to be detected;
the network construction unit is used for constructing a deep neural network according to a plurality of event types to be predicted; wherein the deep neural network comprises a context level event feature extraction sub-network and an event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the context level event characteristics and the event type vector corresponding to the event type of the adjacent word;
the event type vector embedding unit is used for executing event type vector embedding on the event types of the adjacent words to obtain the event type vector;
the word embedding unit is used for executing word vector embedding on the sentence fragments to obtain the word vectors;
a word position vector embedding unit configured to perform word position vector embedding on the word position information to obtain the word position vector;
and the model training unit is used for taking the event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
The present application further provides an electronic device, comprising:
a processor; and
a memory for storing a program for implementing the event confirmation method, wherein the following steps are executed after the device is powered on and the program for implementing the event confirmation method is executed by the processor: acquiring words to be detected in an article; acquiring sentence fragments corresponding to the words to be detected; performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the first word vector, the second word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network; extracting the article-level event features according to the first word vector through the article-level event feature extraction sub-network, extracting the context-level event features according to the second word vector and the word position vector through the context-level event feature extraction sub-network; and acquiring a preset value of the event type corresponding to the word to be detected as the event type included in the article according to the event characteristic at the article level and the event characteristic at the context level through the event type prediction sub-network.
The present application further provides an electronic device, comprising:
a processor; and
a memory for storing a program for implementing the event confirmation method, wherein the following steps are executed after the device is powered on and the program for implementing the event confirmation method is executed by the processor: acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before the word to be detected as event types of a first adjacent word; acquiring event types respectively corresponding to at least one word appearing after the word to be detected as event types of a second adjacent word; acquiring sentence fragments corresponding to the words to be detected; performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; performing word position vector embedding on word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; extracting sub-networks through the article-level event features, extracting article-level event features according to the first word vector, extracting sub-networks through the context-level event features, and extracting context-level event features according to the second word vector and the word position vector; acquiring first probabilities of various event types corresponding to the words to be detected at least according to the article-level event features, the context-level event features and the first event type vectors through the first event type prediction sub-network; and obtaining a second probability of each event type corresponding to the word to be detected according to the article-level event feature, the context-level event feature and the second event type vector at least through the second event type prediction subnetwork; and determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the third event type prediction sub-network and at least the first probability and the second probability.
The present application further provides an electronic device, comprising:
a processor; and
a memory for storing a program for implementing the event confirmation method, wherein the following steps are executed after the device is powered on and the program for implementing the event confirmation method is executed by the processor: acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before the word to be detected as event types of a first adjacent word; acquiring event types respectively corresponding to at least one word appearing after the word to be detected as event types of a second adjacent word; acquiring sentence fragments corresponding to the words to be detected; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the first event type vector, the second event type vector, the word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; extracting a sub-network through the context-level event characteristics, and extracting the context-level event characteristics according to the word vectors and the word position vectors corresponding to the words in the sentence fragments; acquiring a first probability of the word to be detected corresponding to each event type according to the context level event characteristics and the first event type vector through the first event type prediction subnetwork; obtaining a second probability of the word to be detected corresponding to each event type through the second event type prediction sub-network at least according to the context level event characteristics and the second event type vector; and determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the third event type prediction sub-network and at least the first probability and the second probability.
The present application further provides an electronic device, comprising:
a processor; and
a memory for storing a program for implementing the event confirmation method, wherein the following steps are executed after the device is powered on and the program for implementing the event confirmation method is executed by the processor: acquiring words to be detected in an article; acquiring event types corresponding to at least one word appearing before or after the word to be detected respectively, and taking the event types as the event types of adjacent words; acquiring sentence fragments corresponding to the words to be detected; executing event type vector embedding on the event types of the adjacent words to obtain event type vectors; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the event type vector, the word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises a context-level event characteristic extraction sub-network and an event type prediction sub-network; extracting a sub-network through the context-level event characteristics, and extracting the context-level event characteristics according to the word vectors and the word position vectors corresponding to the words in the sentence fragments; and acquiring a predicted value of the event type corresponding to the word to be detected as the event type included in the text by the event type prediction sub-network at least according to the context level event characteristics and the event type vector.
The present application further provides an electronic device, comprising:
a processor; and
a memory for storing a program for implementing an event type prediction model construction method, the apparatus performing the following steps after being powered on and running the program for the event type prediction model construction method through the processor: acquiring a training sample set; the training sample comprises an article corresponding to a word to be detected for training, sentence fragments, and a corresponding relation between word position information of the word in the sentence fragment and an event type; constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting the article-level event features according to the first word vector related to the article; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the article level event characteristics and the context level event characteristics; performing word vector embedding on the article to obtain the first word vector; performing word vector embedding on the sentence fragments to obtain a second word vector; performing word position vector embedding on the word position information to obtain the word position vector; and taking the first word vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
The present application further provides an electronic device, comprising:
a processor; and
a memory for storing a program for implementing an event type prediction model construction method, the apparatus performing the following steps after being powered on and running the program for the event type prediction model construction method through the processor: acquiring a training sample set; the training sample comprises an article corresponding to a word to be detected for training, sentence fragments, word position information of words in the sentence fragments, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the word to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected; constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction sub-network is used for acquiring first probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and first event type vectors corresponding to the event types of the first adjacent words; the second event type prediction sub-network is configured to obtain a second probability of each event type corresponding to the word to be detected according to the article-level event feature, the context-level event feature, and a second event type vector corresponding to the event type of the second adjacent word; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability; performing word vector embedding on the article to obtain the first word vector; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain a second word vector; performing word position vector embedding on the word position information to obtain the word position vector; and taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
The present application further provides an electronic device, comprising:
a processor; and
a memory for storing a program for implementing an event type prediction model construction method, the apparatus performing the following steps after being powered on and running the program for the event type prediction model construction method through the processor: acquiring a training sample set; the training sample comprises sentence fragments corresponding to the training words to be detected, word position information of words in the sentence fragments, event types of first adjacent words, and corresponding relations between the event types of second adjacent words and the event types of the words to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected; constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises a context level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction sub-network is used for acquiring first probabilities of various event types corresponding to the words to be detected according to the context level event characteristics and the first event type vector corresponding to the event type of the first adjacent word; the second event type prediction subnetwork is used for acquiring second probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and second event type vectors corresponding to the event types of the second adjacent words; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain the word vectors; performing word position vector embedding on the word position information to obtain the word position vector; and taking the first event type vector, the second event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
The present application further provides an electronic device, comprising:
a processor; and
a memory for storing a program for implementing an event type prediction model construction method, the apparatus performing the following steps after being powered on and running the program for the event type prediction model construction method through the processor: acquiring a training sample set; the training sample comprises sentence fragments corresponding to the training words to be detected, word position information of words in the sentence fragments, and corresponding relations between event types of adjacent words and the event types of the words to be detected; the adjacent words comprise at least one word appearing before or after the word to be detected; constructing a deep neural network according to a plurality of event types to be predicted; wherein the deep neural network comprises a context level event feature extraction sub-network and an event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the context level event characteristics and the event type vector corresponding to the event type of the adjacent word; performing event type vector embedding on the event types of the adjacent words to obtain the event type vector; performing word vector embedding on the sentence fragments to obtain the word vectors; performing word position vector embedding on the word position information to obtain the word position vector; and taking the event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
The present application also provides a computer-readable storage medium having stored therein instructions, which when run on a computer, cause the computer to perform the various methods described above.
The present application also provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the various methods described above.
Compared with the prior art, the method has the following advantages:
according to the event confirmation method provided by the embodiment of the application, words to be detected in an article are obtained; acquiring sentence fragments corresponding to the words to be detected; performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the first word vector, the second word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network; extracting the article-level event features according to the first word vector through the article-level event feature extraction sub-network, extracting the context-level event features according to the second word vector and the word position vector through the context-level event feature extraction sub-network; acquiring a predicted value of an event type corresponding to the word to be detected as the event type included in the article according to the event type prediction sub-network and at least according to the article-level event characteristics and the context-level event characteristics; the processing mode enables the event recognition to be carried out by combining the information of the article where the word to be detected is located and the information of the peripheral text; therefore, the accuracy of event identification can be effectively improved.
According to the method for constructing the event type prediction model, a training sample set is obtained; the training sample comprises an article corresponding to a word to be detected for training, sentence fragments, and a corresponding relation between word position information of the word in the sentence fragment and an event type; constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to a second word vector related to sentence fragments and a word position vector corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the article level event characteristics and the context level event characteristics; performing word vector embedding on the article to obtain the first word vector; performing word vector embedding on the sentence fragments to obtain a second word vector; performing word position vector embedding on the word position information to obtain the word position vector; taking the first word vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model; the processing mode combines the information of the article where the word to be detected is located and the information of the peripheral text to construct an event type prediction model; therefore, the prediction accuracy of the event type prediction model can be effectively improved. Meanwhile, the processing mode also enables the article-level event characteristics to be trained together with the samples, so that more feedback with the pertinence of the event extraction task can be obtained; therefore, the prediction accuracy of the event type prediction model can be further effectively improved.
Drawings
FIG. 1 is a flow chart of an embodiment of an event validation method provided herein;
FIG. 2a is a schematic diagram of word vector embedding of an embodiment of an event validation method provided herein;
FIG. 2b is a schematic diagram of word position vector embedding for an embodiment of an event validation method provided herein;
FIG. 3 is a schematic diagram of a context-level event feature extraction sub-network of an embodiment of an event validation method provided herein;
FIG. 4 is a diagram of an article-level event feature extraction sub-network according to an embodiment of an event confirmation method provided in the present application;
FIG. 5 is a schematic diagram of an event type prediction subnetwork of an embodiment of an event validation method provided herein;
FIG. 6 is a detailed flow chart of an embodiment of an event confirmation method provided herein;
FIG. 7 is an exemplary diagram of event type vector embedding for an embodiment of an event validation method provided herein;
FIG. 8 is a further schematic diagram of an event type prediction subnetwork of an embodiment of an event validation method provided herein;
FIG. 9 is a detailed flowchart of an embodiment of an event confirmation method provided herein;
FIG. 10 is a schematic diagram of an embodiment of an event confirmation device provided herein;
FIG. 11 is a detailed schematic diagram of an embodiment of an event confirmation device provided herein;
FIG. 12 is a detailed schematic diagram of an embodiment of an event confirmation device provided herein;
FIG. 13 is a schematic diagram of an embodiment of an electronic device provided herein;
FIG. 14 is a flow chart of an embodiment of an event validation method provided herein;
FIG. 15 is a schematic diagram of an event type prediction subnetwork of an embodiment of an event validation method provided herein;
FIG. 16 is a schematic diagram of an embodiment of an event confirmation device provided herein;
FIG. 17 is a schematic diagram of an embodiment of an electronic device provided herein;
FIG. 18 is a flow chart of an embodiment of an event validation method provided herein;
FIG. 19 is a schematic diagram of an event type prediction subnetwork of an embodiment of an event validation method provided herein;
FIG. 20 is a schematic diagram of an embodiment of an event confirmation device provided herein;
FIG. 21 is a schematic diagram of an embodiment of an electronic device provided herein;
FIG. 22 is a flow chart of an embodiment of an event validation method provided herein;
FIG. 23 is a schematic diagram of an event type prediction subnetwork of an embodiment of an event validation method provided herein;
FIG. 24 is a schematic view of an embodiment of an event confirmation device provided herein;
FIG. 25 is a schematic diagram of an embodiment of an electronic device provided herein;
FIG. 26 is a flow diagram of an embodiment of a method for constructing an event type prediction model provided herein;
FIG. 27 is a detailed flow chart of an embodiment of a method for constructing an event type prediction model provided herein;
FIG. 28 is a schematic diagram of an embodiment of an event type prediction model construction apparatus provided in the present application;
FIG. 29 is a detailed schematic diagram of an embodiment of an event type prediction model construction apparatus provided in the present application;
FIG. 30 is a schematic view of an embodiment of an electronic device provided herein;
FIG. 31 is a flow chart of an embodiment of a method for constructing an event type prediction model provided herein;
FIG. 32 is a schematic diagram of an embodiment of an event type prediction model construction apparatus provided in the present application;
FIG. 33 is a schematic view of an embodiment of an electronic device provided herein;
FIG. 34 is a flow chart of an embodiment of a method for constructing an event type prediction model provided herein;
FIG. 35 is a schematic diagram of an embodiment of an event type prediction model construction apparatus provided in the present application;
FIG. 36 is a schematic view of an embodiment of an electronic device provided herein;
FIG. 37 is a flow diagram of an embodiment of a method for constructing an event type prediction model provided herein;
FIG. 38 is a schematic diagram of an embodiment of an event type prediction model construction apparatus provided in the present application;
FIG. 39 is a schematic diagram of an embodiment of an electronic device provided herein.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
In the application, an event confirmation method and device, an event type prediction model construction method and device and an electronic device are provided. Each of the schemes is described in detail in the following examples.
First embodiment
Please refer to fig. 1, which is a flowchart illustrating an embodiment of an event confirmation method according to the present application, wherein an execution body of the method includes an event confirmation apparatus. The event confirmation method provided by the application comprises the following steps:
step S101: acquiring words to be detected in an article; and acquiring a sentence fragment corresponding to the word to be detected.
The article, including unstructured information, such as a news or bulletin, etc. By the method provided by the embodiment of the application, the events in which the user is interested can be extracted from the article comprising the unstructured information and can be presented to the user in a structured mode.
The words to be detected comprise words appearing in the article. The articles can be articles in various languages, such as Chinese or English, and the like. When the article is a Chinese article, the words to be detected include words obtained by segmenting the Chinese article, for example, the text is that "a certain administrative institution just sworn and anyhow should be invited to participate in a ceremony and lead words", and the segmentation result includes the following words: just, solemn, chang, politics, courtyard, invited, attended, established, ceremony, word, etc. When the article is an English article, the words to be detected comprise English words appearing in the article.
The sentence fragments corresponding to the words to be detected comprise text strings which are expanded to the left side and the right side by taking the words to be detected as the center and have the preset word number. And displaying the context information of the words to be detected through the sentence fragments corresponding to the words to be detected. The sentence fragment may or may not be a true complete sentence (natural sentence). From a number of words perspective, the sentence fragment may be a text string with a fixed number of words.
For example, the article includes a sentence "a certain person in an administrative institution who is just sworn is invited to take a good ceremony and give a word", the preset number of words is 11, and if the word to be detected is "just", the sentence fragment is a text string formed by splicing 11 words by centering the word to be detected and expanding 5 words to the left and right sides respectively, the sentence fragment may be a text string formed by splicing the following words in sequence: "empty words", "just", "oath of affidance", "anycast", "administration", "courtyard". Since the word "just" to be detected is the initial word of the article, 5 words expanded leftward cannot be obtained, and therefore, 5 "empty words" are used to indicate words expanded leftward centered on the word "just" to be detected.
It should be noted that, when a word to be detected is used as a center and is expanded to the left and right sides to form a text string (i.e., a sentence fragment) with a preset number of words, the words with the same number can be expanded to the left and right sides, for example, 5 words are expanded to the left and right sides respectively; or expanding different numbers of words to the left and right, such as expanding 3 words to the left and expanding 3 words to the right.
For convenience of description, the embodiment of the present application expresses the sentence fragments as: w {. St-1,wt,wt+1.., wherein wtFor words to be detected, wt-1Is the 1 st word adjacent to the left side of the word to be detected, wt+1Is the adjacent 1 st word at the right side of the word to be detected.
Step S102: performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; and performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain the word position vectors corresponding to the words in the sentence fragments.
After the words to be detected in the article and the sentence fragments corresponding to the words to be detected are obtained in step S101, this step may be entered, and vector embedding (embedding) processing is performed on the words in the article, the words in the sentence fragments, and the position information of the words in the sentence fragments, respectively, to obtain vector expression forms of various information.
Step S102 comprises 3 sub-steps: 1) performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; 2) performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; 3) and performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain the word position vector corresponding to the words in the sentence fragments. The method provided by the embodiment of the present application does not limit the execution sequence of the above 3 sub-steps. The 3 sub-steps described above are described one by one.
1) And performing word vector embedding on the article to obtain a word vector related to the article as a first word vector.
According to the method provided by the embodiment of the application, the article is organized according to word vectors in a word embedding mode, and the word vectors capable of expressing the article semantics are obtained, so that the article-level event features can be conveniently mined according to the word vectors.
In one example, sub-step 1) may include the following sub-steps: 1.1) obtaining words included in the article through a word segmentation algorithm to serve as first words; 1.2) performing word embedding on the first word to obtain a word vector of the first word.
1.1) obtaining words included in the article through a word segmentation algorithm to serve as first words.
In specific implementation, the existing word segmentation algorithm can be adopted to perform word segmentation processing on the article. The existing word segmentation algorithm can be divided into three main categories: a word segmentation method based on character string matching, a word segmentation method based on understanding and a word segmentation method based on statistics. Whether the method is combined with the part-of-speech tagging process or not can be divided into a simple word segmentation method and an integrated method combining word segmentation and tagging. The word segmentation algorithm belongs to the mature prior art, and is not repeated herein, and any one of the existing word segmentation algorithms can be selected according to actual requirements.
1.2) performing word embedding on the first word to obtain a word vector of the first word.
In one example, the method provided in the embodiment of the present application further includes the following steps: a dictionary is constructed, where the dictionary may include all words present in the article. In specific implementation, a dictionary can be constructed by scanning all training chapters.
After the dictionary is constructed, the words in the dictionary may also be indexed such that each word corresponds to a unique numerical identifier. In addition, after the dictionary is built, the word vector training process can be performed on the words in the dictionary to determine the word vector corresponding to the words in the dictionary. In specific implementation, the trained word vector can be directly used.
As shown in fig. 2a, a word vector (word entries) corresponding to each word may be obtained by querying a word vector matrix (word entries) according to the unique identifier of each word. Taking an example where the lexicon includes 10000 words, the word vector matrix is a 10000 word vector dimension (custom) matrix. Each row of the matrix corresponds to a word vector. This matrix may be a randomly initialized matrix that may be updated by training the word vectors.
The above sub-step 1 is explained so far.
2) And performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments, and taking the word vectors as second word vectors.
The processing mode of the 2 nd sub-step is basically the same as that of the 1 st sub-step, the difference includes that the processed words are different, and the words processed by the 2 nd sub-step include the words appearing in the sentence fragments. Since the processing manner of the 2 nd sub-step is substantially the same as that of the 1 st sub-step, it is not described herein again.
3) And performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain the word position vectors corresponding to the words in the sentence fragments.
And the words in the sentence fragments comprise the words to be detected and words obtained by leftward/rightward expansion. Each word corresponds to a word position, and the word position information comprises position information of the words in the sentence fragments.
For convenience of description, in the embodiments of the present application, the word position information corresponding to the sentence fragment is expressed as:P ={...pt-1,pt,pt+1.., wherein ptAs the word w to be detectedtWord position in sentence fragment S, pt-1For the 1 st word w adjacent to the left side of the word to be detectedt-1Word position in sentence fragment S, pt+1For the 1 st word w adjacent to the right side of the word to be detectedt+1Word position in sentence fragment S.
The word position information may be determined according to the position of the word in the sentence fragment relative to the word to be detected, for example, if the word length of the sentence fragment S is fixed to 11, then P { -5, -4, … 0 …,4,5 }; it may also be determined directly from the position of the respective word in the sentence fragment, as indicated by p ═ {0, … 10 }.
As shown in fig. 2b, a position vector (position elements) corresponding to each word may be obtained by querying a position vector matrix (position elements matrix) according to the word position number of each word. Taking the number of words in a sentence fragment as 11 as an example, the position vector matrix is a matrix of 11-word position vector dimension (self-defined). Each row of the matrix corresponds to a word position. This matrix may be a randomly initialized matrix that may be updated by training the word position vector.
For example, if the sentence fragment S { "empty word", "just", "oath", "present", "administrative", "institution length", and P { -5, -4, … 0 …,4,5}, the following words and word position vectors are obtained after the processing of sub-step 3: the word position vector corresponding to the position number-5 of the 1 st "empty word", the word position vector corresponding to the position number-4 of the 2 nd "empty word", the word position vector corresponding to the position number-3 of the 3 rd "empty word", the word position vector corresponding to the position number-2 of the 4 th "empty word", the word position vector corresponding to the position number-1 of the 5 th "empty word", the word position vector corresponding to the position number-0 of the immediately preceding "position number", the word position vector corresponding to the position number 1 of the "suave", the word position vector corresponding to the position number 1 of the "just" corresponding to the position number 0 of the "present" corresponding to the position number 2 ", the word position vector corresponding to the position number 3 of the" administrative "corresponding to the position number 4", and the word position vector corresponding to the position number 5 of the "institution length".
The above 3 rd sub-step is explained so far.
After the first word vector related to the article, the second word vector related to the sentence fragment, and the word position vector corresponding to the word in the sentence fragment are obtained, the next step S103 may be performed.
Step S103: and taking the first word vector, the second word vector and the word position vector as input data of an event type prediction model.
The event type prediction model comprises an article level event characteristic extraction sub-network, a context level event characteristic extraction sub-network and an event type prediction sub-network.
Step S104: extracting the sub-network according to the article-level event characteristics, extracting the article-level event characteristics according to the first word vector, extracting the sub-network according to the context-level event characteristics, and extracting the context-level event characteristics according to the second word vector and the word position vector.
The context level event characteristics comprise characteristics which are extracted from a limited text range around the words to be detected and influence the event types of the words to be detected.
The context-level event features extract the input layer data of the sub-network into the connected second word vector and the word position vector (coordinated entities), so that the sub-network knows which word in the sentence fragment is the word to be detected and the relative position relationship between other words and the word to be detected. The context-level event features extract output layer data of the sub-network as context-level event features. Context-level event features may be extracted from the second word vector and the word position vector via the sub-network.
The context-level event feature extraction sub-network may employ a variety of deep neural network architectures, including but not limited to: convolutional Neural Networks (CNNs), Recurrent Neural Networks (RNNs), and so on.
The context level event feature extraction sub-network shown in fig. 3 is a network whose input layer data is conditioned entities, the network includes a convolution layer and a pooling layer, and the input layer data is processed by the convolution layer and the pooling layer to form data of an output layer, i.e., the context level event feature (CNN vector).
The article-level event characteristics comprise characteristics which are extracted from the whole article where the words to be detected are located and influence the event types of the words to be detected.
The input data of the article-level event feature extraction sub-network is the first word vector, and the output data of the sub-network is the article-level event feature. Through the sub-network, chapter-level event features can be extracted from the first word vector.
The article-level event feature extraction sub-Network may adopt a hierarchical attention Network (hierarchical attention Network), and may also adopt other Network structures, such as a hierarchical Network that does not include an attention layer, or a hierarchical Network that includes only a level 1 Network, and so on.
As shown in fig. 4, in one example, the input layer data of the article-level event feature extraction sub-network is the first word vector, and the network includes 3-level sub-networks, which are respectively: the method comprises the steps that a sentence-level event characteristic determining sub-network, a paragraph-level event type characteristic determining sub-network and an article-level event characteristic determining sub-network are adopted, and input layer data are processed through the 3-level sub-network to form output layer data, namely the article-level event characteristic (document vector). Wherein a sub-network is determined by the sentence-level event features, based on the first word vector (w)0,w1…,wn) Acquiring sentence-level event features (sensor vectors) corresponding to sentences included in the article; determining a sub-network from the paragraph-level event type features, based on sentence-level event features(s) corresponding to sentences included in the chapter0,s1…,sn) Acquiring paragraph level event type features (paramph vectors) corresponding to paragraphs included in the article; determining a sub-network from said article-level event characteristics, based on said paragraph-level event type characteristics (p)0,p1…,pn) And acquiring the article-level event feature (document vector).
It should be noted that the sentence in the sentence-level event characteristic determination sub-network is different from the sentence fragment, and the sentence is usually a natural sentence appearing in an article, that is, a sentence after sentence break is performed according to punctuation marks.
In FIG. 4, the sentence-level event feature determination sub-network, the paragraph-level event type feature determination sub-network, and the article-level event feature determination sub-network all adopt a Bi-directional long-short term memory network structure Bi-LSTM. Since the three subnetworks have the same network structure and the same processing manner, and only differ in the input data and the output data, the following description will be made in detail only for the operation manner of the sentence-level event type determination subnetwork, and reference may be made to the description for the operation manner of the paragraph-level event type determination subnetwork and the article-level event characteristic determination subnetwork.
As shown in fig. 4, the determining a sub-network according to the sentence-level event features and obtaining the sentence-level event features corresponding to the sentences included in the article according to the first word vector may include the following sub-steps: 1) taking the forward sequence of the first word vector related to the sentence as input data of a first LSTM, and acquiring forward sentence-level event characteristics of the sentence through the first LSTM; and taking the reverse sequence of the first word vector related to the sentence as input data of a second LSTM, and acquiring the reverse sentence-level event characteristic of the sentence through the second LSTM; 2) and obtaining sentence-level event characteristics corresponding to sentences included in the article according to the forward sentence-level event characteristics and the reverse sentence-level event characteristics.
The forward sequence of the first word vector refers to a word sequence of words in a sentence arranged in order from left to right. The reverse sequence of the first word vector refers to a word sequence of words in a sentence, which are arranged from right to left.
According to the method provided by the embodiment of the application, the sentence-level event characteristics based on the Bi-LSTM are adopted to determine the sub-network, so that the long-distance dependence relationship between words can be modeled, and modeling can be performed from two directions, and the sentence-level event characteristics can be determined due to the long-distance dependence relationship between words; therefore, the accuracy of sentence-level event characteristics can be effectively improved.
As can be seen from fig. 4, the network structure of the sentence-level event feature determination sub-network may further include an attention layer or a pooling layer (max pooling), etc.; when the sentence-level event characteristics determine that the network structure of the subnetwork can include the attention layer, the obtaining of the sentence-level event characteristics corresponding to the sentences included in the article according to the forward sentence-level event characteristics and the reverse sentence-level event characteristics can be implemented in the following manner: and acquiring sentence-level event characteristics corresponding to sentences included in the article according to the forward sentence-level event characteristics and the reverse sentence-level event characteristics through the attention layer.
It should be noted that the article-level event feature extraction sub-network may also have only one layer, and the article-level event features are determined directly according to the first word vector; or only two layers are included, after each sentence-level event characteristic is determined, the article-level event characteristic is determined directly according to the sentence-level event characteristic, or after the paragraph-level event type is determined directly according to the first word vector, the article-level event characteristic is determined according to the paragraph-level event type.
After the article-level event features and the context-level event features are extracted, the next step can be entered, and the event type of the word to be detected is predicted according to the article-level event features and the context-level event features through the event type prediction sub-network.
Step S105: and acquiring a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the event type prediction sub-network and at least according to the article-level event characteristics and the context-level event characteristics.
As shown in fig. 5, the event type prediction sub-network includes a full connection layer for connecting the article-level event feature and the context-level event feature and an output layer of the event type prediction model, calculates a probability of each event type by integrating various features (article-level event feature and context-level event feature) of the word to be detected through the full connection layer, and then selects an event type with the highest probability as a predicted event type.
The event type may be a time, a region, one or more roles, one or more actions, for example, the event type is "start job" or the like.
The inventor of the present invention finds that the content discussed in the whole article can play an auxiliary role in determining whether a word represents the occurrence of an event, so that the method provided by the embodiment of the present invention combines the article-level event features with the context-level event features, wherein the article-level event features include information of the article, and the context-level event features include information of a sentence segment where the word to be detected is located; the processing mode expands the information amount predicted by the event type, and assists in judging which event type the word to be detected is according to the information of the article; therefore, full-text information can be effectively utilized to assist in predicting event types.
Please refer to fig. 6, which is a flowchart illustrating an embodiment of an event confirmation method according to the present application. In one example, the method further comprises the steps of:
step S601: and acquiring the event types corresponding to at least one word appearing before or after the word to be detected respectively as the event types of the adjacent words.
The adjacent word may be a word appearing before or after the word to be detected. If prediction is carried out according to adjacent words before the word to be detected, the prediction can be called sequential prediction; if prediction is performed based on neighboring words after the word to be detected, it may be referred to as reverse order prediction.
The adjacent words can be words adjacent to the words to be detected, or words with other words spaced from the words to be detected. For example, if the sentence segment corresponding to the word "to be detected" is "a word that is just sworn and then an officials in a particular institution is invited to participate in a particular ceremony and then the word" to be detected ", the adjacent words of the word to be detected may be just sworn, administrative, institution, invitation, participation, establishment, ceremony, word, and so on.
According to the method provided by the embodiment of the application, when the event type of the word to be detected is predicted, the event type of at least one adjacent word around the word to be detected is considered, so that information is provided for judging the event type of the word to be detected, and the judgment of the event type of the word to be detected is facilitated. Therefore, the event type of the neighboring word is predicted in advance.
It should be noted that the use of multiple adjacent words is not necessarily preferred over a single adjacent word because: during prediction, event types of previous adjacent words or next adjacent words are also predicted by the model, and errors may exist, if event types of previous n predicted words are all correct, the prediction result of the event type of the current word to be detected is more helpful, and if wrong prediction exists in n words, prediction of the current word to be detected may be influenced, and even wrong prediction results are obtained. In specific implementation, the values of the adjacent words may be adjusted according to specific situations.
Step S602: and executing event type vector embedding on the event types of the adjacent words to obtain event type vectors.
As shown in fig. 7, according to the number of each event type, an event type vector (event type elements) corresponding to each event type may be obtained by querying an event type vector matrix (event type elements matrix). Taking 30 event types in total as an example, the event type vector matrix is a 30-by-30 event type vector dimension (custom) matrix. Each row of the matrix corresponds to an event type. This matrix may be a randomly initialized matrix that may be updated by training the event type vector.
Please refer to fig. 8, which is a detailed diagram of another event type prediction sub-network according to an embodiment of the event confirmation method provided in the present application. In the case shown in fig. 8, the obtaining of the predicted value of the event type corresponding to the word to be detected through the event type prediction sub-network and at least according to the article-level event feature and the context-level event feature may be implemented as follows: and acquiring the predicted value at least according to the article-level event feature, the context-level event feature and the event type vector through the event type prediction sub-network.
According to the method provided by the embodiment of the application, the event types corresponding to at least one word appearing before or after the word to be detected are obtained and used as the event types of the adjacent words; executing event type vector embedding on the event types of the adjacent words to obtain event type vectors; acquiring the predicted value according to the article-level event feature, the context-level event feature and the event type vector through the event type prediction subnet; according to the processing mode, on the basis of predicting the event type of the word to be detected according to the article-level event characteristics and the context-level event characteristics, the event type information of the adjacent words of the word to be detected is also introduced, and the auxiliary judgment is carried out on the event type of the word to be detected according to the event characteristics of the adjacent words; therefore, the accuracy of event type prediction can be effectively improved.
It should be noted that, to implement the method provided in the embodiment of the present application, an event type prediction model is first constructed, and the event type prediction model may be learned from training data.
Please refer to fig. 9, which is a flowchart illustrating an embodiment of an event confirmation method according to the present application. In this embodiment, the method further includes the steps of:
step S901: and learning from a training sample set to obtain the event type prediction model.
The training sample set comprises a plurality of training samples. The training samples comprise articles corresponding to the to-be-detected words for training, sentence fragments, and corresponding relations between word position information corresponding to the words in the sentence fragments and event types.
After a training sample set is obtained, the event type prediction model can be obtained through learning from the training sample set through a deep learning algorithm. Since the deep learning algorithm belongs to the mature prior art, it is not described herein again.
In one example, to build the event type prediction model, the method further comprises the following steps: acquiring event types respectively corresponding to at least one word appearing before or after the word to be detected for training, and taking the event types as event types of adjacent words for training; accordingly, step S901 may adopt the following manner: and learning to obtain the event type prediction model according to the training sample set and the event types of the training adjacent words corresponding to the training words to be detected.
When the event type prediction model is trained, the loss function of the event type prediction sub-network can adopt a binary cross entropy function or a common cross entropy function.
As can be seen from the foregoing embodiments, the event confirmation method provided in the embodiments of the present application obtains the to-be-detected word in the article; acquiring sentence fragments corresponding to the words to be detected; performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the first word vector, the second word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network, extracting article-level event features according to the first word vector through the article-level event feature extraction sub-network, extracting context-level event features according to the second word vector and the word position vector through the context-level event feature extraction sub-network; acquiring a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the article-level event characteristic and the context-level event characteristic through the event type prediction sub-network; the processing mode enables the event recognition to be carried out by combining the information of the article where the word to be detected is located and the information of the peripheral text; therefore, the accuracy of event identification can be effectively improved.
In the foregoing embodiment, an event confirmation method is provided, and correspondingly, an event confirmation apparatus is also provided in the present application. The apparatus corresponds to an embodiment of the method described above.
Second embodiment
Please refer to fig. 10, which is a schematic diagram of an embodiment of an event confirmation apparatus of the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
The present application further provides an event confirmation apparatus, comprising:
a to-be-detected word acquiring unit 1001 configured to acquire a to-be-detected word in an article;
a sentence fragment acquiring unit 1002, configured to acquire a sentence fragment corresponding to the word to be detected;
a first word embedding unit 1003, configured to perform word vector embedding on the article to obtain a word vector related to the article, where the word vector is used as a first word vector;
a second word embedding unit 1004, configured to perform word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors;
a word position vector embedding unit 1005, configured to perform word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
a model input unit 1006, configured to use the first word vector, the second word vector, and the word position vector as input data of an event type prediction model, where the event type prediction model includes an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, and an event type prediction sub-network;
a first feature extraction unit 1007, configured to extract a sub-network from the article-level event features and extract article-level event features according to the first word vector;
a second feature extraction unit 1008, configured to extract a sub-network from the context-level event features, and extract context-level event features according to the second word vector and the word position vector;
an event type predicting unit 1009 is configured to obtain, through the event type prediction sub-network, a predicted value of an event type corresponding to the word to be detected as an event type included in the article, at least according to the article-level event feature and the context-level event feature.
Please refer to fig. 11, which is a detailed schematic diagram of an embodiment of an event confirmation apparatus according to the present application. Optionally, the method further includes:
an event type acquiring unit 1101, configured to acquire event types respectively corresponding to at least one word appearing before or after the word to be detected, as event types of adjacent words;
an event type vector embedding unit 1102, configured to perform event type vector embedding on the event types of the adjacent words to obtain an event type vector;
the event type prediction unit 1009 is specifically configured to obtain the predicted value according to the article-level event feature, the context-level event feature, and the event type vector through the event type prediction subnetwork.
Alternatively to this, the first and second parts may,
the article level event feature extraction sub-network comprises: a sentence-level event characteristic determining sub-network, a paragraph-level event type characteristic determining sub-network and an article-level event characteristic determining sub-network;
the first feature extraction unit 1007 includes:
a sentence-level event feature determining subunit, configured to determine a sub-network according to the sentence-level event features, and obtain, according to the first word vector, sentence-level event features corresponding to sentences included in the article;
a paragraph level event feature determining subunit, configured to determine a sub-network through the paragraph level event type feature, and obtain, according to a sentence level event feature corresponding to a sentence included in the article, a paragraph level event type feature corresponding to a paragraph included in the article;
and the article-level event characteristic determining subunit is used for determining a sub-network according to the article-level event characteristics and acquiring the article-level event characteristics according to the paragraph-level event type characteristics.
Optionally, the network structure of the sentence-level event feature determination sub-network comprises a Bi-directional long-short term memory network structure Bi-LSTM;
the sentence-level event feature determining subunit is specifically configured to use a forward sequence of the first word vector related to the sentence as input data of a first LSTM, and obtain a forward sentence-level event feature of the sentence through the first LSTM; and taking the reverse sequence of the first word vector related to the sentence as input data of a second LSTM, and acquiring reverse sentence-level event characteristics of the sentence through the second LSTM; and obtaining sentence-level event characteristics corresponding to sentences included in the article according to the forward sentence-level event characteristics and the reverse sentence-level event characteristics.
Optionally, the sentence-level event feature determination sub-network further comprises an attention layer;
the obtaining sentence-level event features corresponding to sentences included in the article according to the forward sentence-level event features and the reverse sentence-level event features includes:
and acquiring sentence-level event characteristics corresponding to sentences included in the article according to the forward sentence-level event characteristics and the reverse sentence-level event characteristics through the attention layer.
Optionally, the context-level event feature extraction sub-network is based on a convolutional neural network structure.
Please refer to fig. 12, which is a detailed schematic diagram of an embodiment of an event confirmation apparatus according to the present application. Optionally, the method further includes:
a model building unit 1201, configured to learn from a training sample set to obtain the event type prediction model;
the training samples comprise articles and sentence fragments corresponding to the words to be detected for training, and the corresponding relation between word position information corresponding to the words in the sentence fragments and event types.
Optionally, the method further includes:
the training adjacent word event type acquiring unit is used for acquiring an event type corresponding to at least one word appearing before or after the training to-be-detected word as the event type of the training adjacent word;
the model building unit 1201 is specifically configured to learn to obtain the event type prediction model according to the training sample set and the event types of the training neighboring words corresponding to the training words to be detected.
Third embodiment
Please refer to fig. 13, which is a diagram illustrating an embodiment of an electronic device according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the description of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
An electronic device of the present embodiment includes: a processor 1301 and a memory 1302; the memory is used for storing a program for realizing the event confirmation method, and after the equipment is powered on and runs the program for realizing the event confirmation method through the processor, the following steps are executed: acquiring words to be detected in an article; acquiring sentence fragments corresponding to the words to be detected; performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the first word vector, the second word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network; extracting the article-level event features according to the first word vector through the article-level event feature extraction sub-network, extracting the context-level event features according to the second word vector and the word position vector through the context-level event feature extraction sub-network; and acquiring a preset value of the event type corresponding to the word to be detected as the event type included in the article according to the event characteristic at the article level and the event characteristic at the context level through the event type prediction sub-network.
In the first embodiment, an event confirmation method is provided, and correspondingly, another event confirmation method is also provided.
Fourth embodiment
Please refer to fig. 14, which is a flowchart illustrating an embodiment of an event confirmation method according to the present application, wherein an execution body of the method includes an event confirmation apparatus. Since the method embodiment corresponds to the method embodiment of the first embodiment, the description is relatively simple, and the relevant points can be referred to the partial description of the first embodiment. The method embodiments described below are merely illustrative.
The event confirmation method provided by the application comprises the following steps:
step S1401: acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before the word to be detected as event types of a first adjacent word; acquiring event types respectively corresponding to at least one word appearing after the word to be detected as event types of a second adjacent word; and acquiring sentence fragments corresponding to the words to be detected.
Step S1402: performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; and performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments.
Step S1403: and taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network.
Step S1404: extracting the sub-network according to the article-level event characteristics, extracting the article-level event characteristics according to the first word vector, extracting the sub-network according to the context-level event characteristics, and extracting the context-level event characteristics according to the second word vector and the word position vector.
Step S1405: acquiring first probabilities of various event types corresponding to the words to be detected at least according to the article-level event features, the context-level event features and the first event type vectors through the first event type prediction subnetwork; and acquiring second probabilities of various event types corresponding to the words to be detected at least according to the article-level event features, the context-level event features and the second event type vectors through the second event type prediction sub-network.
As shown in fig. 15, the first event type prediction sub-network includes a full connection layer for connecting the article-level event feature, the context-level event feature, and the first event type vector, and calculates a probability of each event type by integrating various features (the article-level event feature, the context-level event feature, and the first event type vector) of the word to be detected through the full connection layer as a first probability. The second event type prediction sub-network comprises a full connection layer for connecting the article-level event feature, the context-level event feature and the second event type vector, and the probability of each event type is calculated by integrating various features (the article-level event feature, the context-level event feature and the second event type vector) of the word to be detected through the full connection layer to serve as a second probability.
Step S1406: and determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the third event type prediction sub-network and at least the first probability and the second probability.
And the third event type prediction sub-network comprehensively considers the first probability and the second probability and determines the predicted value of the event type of the word to be detected. For example, the first probability and the second probability corresponding to each event type may be averaged, and then the event type with the highest probability may be selected as the predicted event type.
As can be seen from the foregoing embodiments, the event confirmation method provided in the embodiments of the present application obtains the to-be-detected word in the article; acquiring event types respectively corresponding to at least one word appearing before the word to be detected as event types of a first adjacent word; acquiring event types respectively corresponding to at least one word appearing after the word to be detected as event types of a second adjacent word; acquiring sentence fragments corresponding to the words to be detected; performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; performing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network, extracting article-level event features according to the first word vector through the article-level event feature extraction sub-network, extracting context-level event features according to the second word vector and the word position vector through the context-level event feature extraction sub-network; acquiring first probabilities of various event types corresponding to the words to be detected according to the article-level event features, the context-level event features and the first event type vectors through the first event type prediction sub-network; acquiring a second probability of each event type corresponding to the word to be detected according to the article-level event feature, the context-level event feature and the second event type vector through the second event type prediction subnetwork; determining a predicted value of the event type of the word to be detected according to the first probability and the second probability through the third event type prediction sub-network; the processing mode combines the information of the article where the word to be detected is located, the information of the peripheral text and the event type information of adjacent words before and after the word to be detected to perform event identification; therefore, the accuracy of event identification can be effectively improved.
In the foregoing embodiment, an event confirmation method is provided, and correspondingly, an event confirmation apparatus is also provided in the present application. The apparatus corresponds to an embodiment of the method described above.
Fifth embodiment
Please refer to fig. 16, which is a schematic diagram of an embodiment of an event confirmation apparatus of the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
The present application further provides an event confirmation apparatus, comprising:
the word to be detected acquiring unit 1601 is used for acquiring a word to be detected in an article;
a sentence fragment obtaining unit 1602, configured to obtain a sentence fragment corresponding to the word to be detected;
a first event type obtaining unit 1603, configured to obtain event types respectively corresponding to at least one word appearing before the word to be detected, as event types of a first adjacent word;
a second event type obtaining unit 1604, configured to obtain event types respectively corresponding to at least one word appearing after the word to be detected, as event types of a second adjacent word;
a first word embedding unit 1605, configured to perform word vector embedding on the article, to obtain a word vector related to the article, which is used as a first word vector;
a second word embedding unit 1606, configured to perform word vector embedding on the sentence fragment, to obtain a word vector related to the sentence fragment, and use the word vector as a second word vector;
a word position vector embedding unit 1607, configured to perform word position vector embedding on the word position information corresponding to the words in the sentence fragments, so as to obtain word position vectors corresponding to the words in the sentence fragments;
a first event type vector embedding unit 1608, configured to perform event type vector embedding on the event type of the first neighboring word, to obtain a first event type vector;
a second event type vector embedding unit 1609, configured to perform event type vector embedding on the event type of the second neighboring word, so as to obtain a second event type vector;
a model input unit 1610, configured to use the first word vector, the first event type vector, the second word vector, and the word position vector as input data of an event type prediction model, where the event type prediction model includes an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network, and a third event type prediction sub-network;
a first feature extraction unit 1611, configured to extract a sub-network from the article-level event features, and extract article-level event features according to the first word vector;
a second feature extraction unit 1612, configured to extract, through the context-level event feature extraction sub-network, a context-level event feature according to the second word vector and the word position vector;
a first event type prediction unit 1613, configured to obtain, by using the first event type prediction sub-network, first probabilities of various event types corresponding to the to-be-detected word at least according to the article-level event feature, the context-level event feature, and the first event type vector;
a second event type prediction unit 1614, configured to obtain, by using the second event type prediction sub-network, a second probability of each event type corresponding to the word to be detected according to at least the article-level event feature, the context-level event feature, and the second event type vector;
an event type determining unit 1615, configured to determine, by the third event type prediction sub-network, a prediction value of an event type corresponding to the word to be detected as the event type included in the article according to at least the first probability and the second probability.
Sixth embodiment
Please refer to fig. 17, which is a diagram illustrating an embodiment of an electronic device according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the description of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
An electronic device of the present embodiment includes: a processor 1701 and a memory 1702; the memory is used for storing a program for realizing the event confirmation method, and after the equipment is powered on and runs the program for realizing the event confirmation method through the processor, the following steps are executed: acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before the word to be detected as event types of a first adjacent word; acquiring event types respectively corresponding to at least one word appearing after the word to be detected as event types of a second adjacent word; acquiring sentence fragments corresponding to the words to be detected; performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; performing word position vector embedding on word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; extracting sub-networks through the article-level event features, extracting article-level event features according to the first word vector, extracting sub-networks through the context-level event features, and extracting context-level event features according to the second word vector and the word position vector; acquiring first probabilities of various event types corresponding to the words to be detected at least according to the article-level event features, the context-level event features and the first event type vectors through the first event type prediction sub-network; and obtaining a second probability of each event type corresponding to the word to be detected according to the article-level event feature, the context-level event feature and the second event type vector at least through the second event type prediction subnetwork; and determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the third event type prediction sub-network and at least the first probability and the second probability.
In the first embodiment, an event confirmation method is provided, and correspondingly, another event confirmation method is also provided in the present application.
Seventh embodiment
Please refer to fig. 18, which is a flowchart illustrating an embodiment of an event confirmation method according to the present application, wherein an execution body of the method includes an event confirmation apparatus. Since the method embodiment corresponds to the method embodiment of the first embodiment, the description is relatively simple, and the relevant points can be referred to the partial description of the first embodiment. The method embodiments described below are merely illustrative.
The event confirmation method provided by the application comprises the following steps:
step S1801: acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before the word to be detected as event types of a first adjacent word; acquiring event types respectively corresponding to at least one word appearing after the word to be detected as event types of a second adjacent word; and acquiring sentence fragments corresponding to the words to be detected.
Step S1802: executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments; and performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments.
Step S1803: using the first event type vector, the second event type vector, the word vector, and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network, and a third event type prediction sub-network.
Step S1804: and extracting a sub-network through the context-level event characteristics, and extracting the context-level event characteristics according to the word vectors and the word position vectors corresponding to the words in the sentence fragments.
Step S1805: acquiring a first probability of the word to be detected corresponding to each event type according to the context-level event characteristics and the first event type vector through the first event type prediction subnetwork; and acquiring a second probability of the words to be detected corresponding to various event types through the second event type prediction sub-network at least according to the context level event characteristics and the second event type vector.
As shown in fig. 19, the first event type prediction subnetwork includes a fully-connected layer for connecting the context-level event feature and the first event type vector, and the probability of each event type is calculated by integrating various features (context-level event feature and first event type vector) of the word to be detected through the fully-connected layer as a first probability. And the second event type prediction sub-network comprises a full connection layer for connecting the context level event characteristics and the second event type vector, and the probability of each event type is calculated by integrating various characteristics (the context level event characteristics and the second event type vector) of the word to be detected through the full connection layer to serve as a second probability.
Step S1806: and determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the third event type prediction sub-network and at least the first probability and the second probability.
And the third event type prediction sub-network comprehensively considers the first probability and the second probability and determines the predicted value of the event type of the word to be detected. For example, the first probability and the second probability corresponding to each event type may be averaged, and then the event type with the highest probability may be selected as the predicted event type.
As can be seen from the foregoing embodiments, the event confirmation method provided in the embodiments of the present application obtains the to-be-detected word in the article; acquiring event types respectively corresponding to at least one word appearing before the word to be detected as event types of a first adjacent word; acquiring event types respectively corresponding to at least one word appearing after the word to be detected as event types of a second adjacent word; acquiring sentence fragments corresponding to the words to be detected; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the first event type vector, the second event type vector, the word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises a context level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network, and extracting context level event features according to the word vector and the word position vector corresponding to words in the sentence fragments through the context level event feature extraction sub-network; acquiring a first probability of the word to be detected corresponding to each event type according to the context level event characteristics and the first event type vector through the first event type prediction subnetwork; acquiring a second probability of the word to be detected corresponding to each event type according to the context level event characteristics and the second event type vector through the second event type prediction sub-network; determining a predicted value of the event type of the word to be detected according to the first probability and the second probability through the third event type prediction subnetwork; the processing mode enables the information of the text around the word to be detected and the event type information of the adjacent words before and after the word to be detected to be combined for event recognition; therefore, the accuracy of event identification can be effectively improved.
In the foregoing embodiment, an event confirmation method is provided, and correspondingly, an event confirmation apparatus is also provided in the present application. The apparatus corresponds to an embodiment of the method described above.
Eighth embodiment
Please refer to fig. 20, which is a schematic diagram of an embodiment of an event confirmation apparatus of the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
The present application further provides an event confirmation apparatus, comprising:
a to-be-detected word acquiring unit 2001 for acquiring a to-be-detected word in an article;
a sentence fragment obtaining unit 2002 for obtaining a sentence fragment corresponding to the word to be detected;
a first event type obtaining unit 2003, configured to obtain event types respectively corresponding to at least one word appearing before the word to be detected, as event types of a first adjacent word;
a second event type obtaining unit 2004, configured to obtain event types corresponding to at least one word appearing after the word to be detected, as event types of a second adjacent word;
a first event type vector embedding unit 2005, configured to perform event type vector embedding on the event type of the first neighboring word to obtain a first event type vector;
a second event type vector embedding unit 2006, configured to perform event type vector embedding on the event type of the second neighboring word to obtain a second event type vector;
a word embedding unit 2007, configured to perform word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments;
a word position vector embedding unit 2008, configured to perform word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
a model input unit 2009, configured to use the first event type vector, the second event type vector, the word vector, and the word position vector as input data of an event type prediction model, where the event type prediction model includes a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network, and a third event type prediction sub-network;
a feature extraction unit 2010, configured to extract a sub-network according to the context-level event features, and extract context-level event features according to the word vectors and the word position vectors corresponding to the words in the sentence fragments;
a first event type predicting unit 2011, configured to obtain, by using the first event type prediction sub-network, first probabilities that the to-be-detected word corresponds to various event types at least according to the context-level event features and the first event type vector;
a second event type prediction unit 2012, configured to obtain, by using the second event type prediction sub-network, a second probability that the word to be detected corresponds to each event type at least according to the context-level event feature and the second event type vector;
an event type determining unit 2013, configured to determine, by the third event type prediction sub-network, a prediction value of an event type corresponding to the word to be detected as an event type included in the article according to at least the first probability and the second probability.
Ninth embodiment
Please refer to fig. 21, which is a diagram illustrating an embodiment of an electronic device according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the description of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
An electronic device of the present embodiment includes: a processor 2101 and memory 2102; the memory is used for storing a program for realizing the event confirmation method, and after the equipment is powered on and runs the program for realizing the event confirmation method through the processor, the following steps are executed: acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before the word to be detected as event types of a first adjacent word; acquiring event types respectively corresponding to at least one word appearing after the word to be detected as event types of a second adjacent word; acquiring sentence fragments corresponding to the words to be detected; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the first event type vector, the second event type vector, the word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; extracting a sub-network through the context-level event characteristics, and extracting the context-level event characteristics according to the word vectors and the word position vectors corresponding to the words in the sentence fragments; acquiring a first probability of the word to be detected corresponding to each event type according to the context level event characteristics and the first event type vector through the first event type prediction subnetwork; obtaining a second probability of the word to be detected corresponding to each event type through the second event type prediction sub-network at least according to the context level event characteristics and the second event type vector; and determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the third event type prediction sub-network and at least the first probability and the second probability.
In the first embodiment, an event confirmation method is provided, and correspondingly, another event confirmation method is also provided in the present application.
Tenth embodiment
Please refer to fig. 22, which is a flowchart illustrating an embodiment of an event confirmation method according to the present application, wherein an execution body of the method includes an event confirmation apparatus. Since the method embodiment corresponds to the method embodiment of the first embodiment, the description is relatively simple, and the relevant points can be referred to the partial description of the first embodiment. The method embodiments described below are merely illustrative.
The event confirmation method provided by the application comprises the following steps:
step S2201: acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before or after the word to be detected as event types of adjacent words; and obtaining sentence fragments corresponding to the words to be detected.
Step S2202: executing event type vector embedding on the event types of the adjacent words to obtain event type vectors; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments; and performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain the word position vectors corresponding to the words in the sentence fragments.
Step S2203: and taking the event type vector, the word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises a context-level event feature extraction sub-network and an event type prediction sub-network.
Step S2204: and extracting a sub-network through the context-level event characteristics, and extracting the context-level event characteristics according to the word vectors and the word position vectors corresponding to the words in the sentence fragments.
Step S2205: and acquiring a predicted value of the event type of the word to be detected as the event type included in the article according to the event type prediction sub-network and at least the context level event characteristics and the event type vector.
As shown in fig. 23, the event type prediction sub-network includes a fully connected layer for connecting the context-level event features and the event type vector, and calculates a probability of each event type by integrating various features (context-level event features and event type vector) of the word to be detected through the fully connected layer, and then selects an event type with the highest probability as a predicted event type.
As can be seen from the foregoing embodiments, the event confirmation method provided in the embodiments of the present application obtains the to-be-detected word in the article; acquiring event types respectively corresponding to at least one word appearing before or after the word to be detected as event types of adjacent words; acquiring sentence fragments corresponding to the words to be detected; executing event type vector embedding on the event types of the adjacent words to obtain event type vectors; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the event type vector, the word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises a context level event feature extraction sub-network and an event type prediction sub-network, extracting context level event features according to the word vector and the word position vector corresponding to words in the sentence fragments through the context level event feature extraction sub-network; acquiring a predicted value of the event type of the word to be detected according to the context-level event characteristics and the event type vector through the event type prediction subnetwork; the processing mode enables the information of the text around the word to be detected and the event type information of the adjacent word before or after the word to be detected to be combined for event recognition; therefore, the accuracy of event identification can be effectively improved.
In the foregoing embodiment, an event confirmation method is provided, and correspondingly, an event confirmation apparatus is also provided in the present application. The apparatus corresponds to an embodiment of the method described above.
Eleventh embodiment
Please refer to fig. 24, which is a schematic diagram of an embodiment of an event confirmation apparatus of the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
The present application further provides an event confirmation apparatus, comprising:
a to-be-detected word obtaining unit 2401, configured to obtain a to-be-detected word in an article;
a sentence fragment obtaining unit 2402, configured to obtain a sentence fragment corresponding to the word to be detected;
an event type acquiring unit 2403, configured to acquire an event type corresponding to at least one word appearing before or after the word to be detected, as an event type of an adjacent word;
an event type vector embedding unit 2404, configured to perform event type vector embedding on the event types of the adjacent words to obtain an event type vector;
a word embedding unit 2405, configured to perform word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments;
a word position vector embedding unit 2406, configured to perform word position vector embedding on the word position information corresponding to the word in the sentence fragment to obtain a word position vector corresponding to the word in the sentence fragment;
a model input unit 2407 configured to take the event type vector, the word vector, and the word position vector as input data of an event type prediction model, where the event type prediction model includes a context-level event feature extraction sub-network and an event type prediction sub-network;
a feature extraction unit 2408, configured to extract, through the context-level event feature extraction sub-network, a context-level event feature according to the word vector and the word position vector corresponding to a word in the sentence fragment;
an event type prediction unit 2409, configured to obtain, by the event type prediction subnetwork, a prediction value of an event type corresponding to the word to be detected as an event type included in the article according to at least the context-level event feature and the event type vector.
Twelfth embodiment
Please refer to fig. 25, which is a diagram illustrating an embodiment of an electronic device according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the description of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
An electronic device of the present embodiment includes: a processor 2501 and a memory 2502; the memory is used for storing a program for realizing the event confirmation method, and after the equipment is powered on and runs the program for realizing the event confirmation method through the processor, the following steps are executed: acquiring words to be detected in an article; acquiring event types corresponding to at least one word appearing before or after the word to be detected respectively, and taking the event types as the event types of adjacent words; acquiring sentence fragments corresponding to the words to be detected; executing event type vector embedding on the event types of the adjacent words to obtain event type vectors; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the event type vector, the word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises a context-level event characteristic extraction sub-network and an event type prediction sub-network; extracting a sub-network through the context-level event characteristics, and extracting the context-level event characteristics according to the word vectors and the word position vectors corresponding to the words in the sentence fragments; and acquiring a predicted value of the event type corresponding to the word to be detected as the event type included in the text by the event type prediction sub-network at least according to the context level event characteristics and the event type vector.
In the first embodiment, an event confirmation method is provided, and correspondingly, the present application further provides an event type prediction model construction method. The method corresponds to the embodiment of the method described above.
Thirteenth embodiment
Please refer to fig. 26, which is a flowchart illustrating an embodiment of a method for constructing an event type prediction model according to the present application, wherein an execution subject of the method includes an event type prediction model constructing apparatus. Since the method embodiment is a part of the method embodiment of the first embodiment, the description is relatively simple, and relevant parts can be referred to part of the description of the method embodiment. The method embodiments described below are merely illustrative.
The method for constructing the event type prediction model comprises the following steps:
step S2601: a training sample set is obtained.
The training sample comprises an article corresponding to the to-be-detected word for training, sentence fragments, and a corresponding relation between word position information of the word in the sentence fragments and an event type.
Step S2602: and constructing a deep neural network according to a plurality of event types to be predicted.
The event type to be predicted refers to an event type which can be predicted by an event type prediction model.
The deep neural network comprises an article level event feature extraction sub-network, a context level event feature extraction sub-network and an event type prediction sub-network. The article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; and the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the article level event characteristics and the context level event characteristics.
Step S2603: performing word vector embedding on the article to obtain the first word vector; performing word vector embedding on the sentence fragments to obtain a second word vector; and performing word position vector embedding on the word position information to obtain the word position vector.
Step S2604: and taking the first word vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
The loss function of the event type prediction sub-network includes, but is not limited to, a binary cross entropy function.
Please refer to fig. 27, which is a flowchart illustrating an embodiment of a method for constructing an event type prediction model according to the present application. In this embodiment, the method further includes the steps of:
step S2701: and acquiring the event types corresponding to at least one word appearing before or after the word to be detected respectively as the event types of the adjacent words.
Step S2702: and executing event type vector embedding on the event types of the adjacent words to obtain event type vectors.
In this case, the event type prediction sub-network is specifically configured to obtain the predicted value according to the article-level event feature, the context-level event feature, and the event type vector. Accordingly, the input data of the deep neural network further includes the event type vector.
As can be seen from the above embodiments, the event type prediction model construction method provided in the embodiments of the present application obtains a training sample set; the training sample comprises an article, a sentence fragment and a corresponding relation between word position information of words in the sentence fragment and event types, wherein the article and the sentence fragment correspond to the words to be detected for training; constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting the article-level event features according to the first word vector related to the article; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the article level event characteristics and the context level event characteristics; performing word vector embedding on the article to obtain the first word vector; performing word vector embedding on the sentence fragments to obtain a second word vector; performing word position vector embedding on the word position information to obtain the word position vector; taking the first word vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model; the processing mode combines the information of the article where the word to be detected is located and the information of the peripheral text to construct an event type prediction model; therefore, the prediction accuracy of the event type prediction model can be effectively improved. Meanwhile, the processing mode also enables the article-level event characteristics to be trained together with the samples, so that more feedback which is pertinent to the event extraction task can be obtained; therefore, the prediction accuracy of the event type prediction model can be further effectively improved.
In the foregoing embodiment, an event type prediction model construction method is provided, and correspondingly, the present application also provides an event type prediction model construction device. The apparatus corresponds to an embodiment of the method described above.
Fourteenth embodiment
Please refer to fig. 28, which is a schematic diagram of an embodiment of an event type prediction model construction apparatus according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
The present application further provides an event type prediction model building apparatus, including:
a training sample acquisition unit 2801 configured to acquire a training sample set; the training sample comprises an article corresponding to a word to be detected for training, sentence fragments, and a corresponding relation between word position information of the word in the sentence fragment and an event type;
a network construction unit 2802, configured to construct a deep neural network according to multiple event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the article level event characteristics and the context level event characteristics;
a first word embedding unit 2803, configured to perform word vector embedding on the article to obtain the first word vector;
a second word embedding unit 2804, configured to perform word vector embedding on the sentence fragments to obtain the second word vector;
a word position vector embedding unit 2805 configured to perform word position vector embedding on the word position information to obtain the word position vector;
a model training unit 2806, configured to use the first word vector, the second word vector, and the word position vector as input data of the deep neural network, use the event type as output data of the deep neural network, and train the deep neural network according to the training sample set to obtain an event type prediction model.
Please refer to fig. 29, which is a schematic diagram of an embodiment of an event type prediction model construction apparatus according to the present application. Optionally, the apparatus further comprises:
an event type obtaining unit 2901, configured to obtain event types corresponding to at least one word appearing before or after the word to be detected respectively, as event types of adjacent words.
An event type vector embedding unit 2902, configured to perform event type vector embedding on the event types of the neighboring words, so as to obtain an event type vector.
In this case, the event type prediction sub-network is specifically configured to obtain the predicted value according to the article-level event feature, the context-level event feature, and the event type vector. Accordingly, the input data of the deep neural network further includes the event type vector.
Fifteenth embodiment
Please refer to fig. 30, which is a diagram illustrating an embodiment of an electronic device according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the description of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
An electronic device of the present embodiment includes: a processor 3001 and a memory 3002; the memory is used for storing a program for realizing the event type prediction model building method, and after the device is powered on and runs the program for realizing the event type prediction model building method through the processor, the following steps are executed: acquiring a training sample set; the training sample comprises an article corresponding to a word to be detected for training, sentence fragments, and a corresponding relation between word position information of the word in the sentence fragment and an event type; constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting the article-level event features according to the first word vector related to the article; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the article level event characteristics and the context level event characteristics; performing word vector embedding on the article to obtain the first word vector; performing word vector embedding on the sentence fragments to obtain a second word vector; performing word position vector embedding on the word position information to obtain the word position vector; and taking the first word vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
In the fourth embodiment, an event confirmation method is provided, and correspondingly, the present application further provides an event type prediction model construction method. The method corresponds to the embodiment of the method described above.
Sixteenth embodiment
Please refer to fig. 31, which is a flowchart illustrating an embodiment of a method for constructing an event type prediction model according to the present application, wherein an execution subject of the method includes an event type prediction model constructing apparatus. Since the method embodiment is a part of the method embodiment of the fourth embodiment, the description is relatively simple, and relevant parts can be referred to part of the description of the method embodiment. The method embodiments described below are merely illustrative.
The method for constructing the event type prediction model comprises the following steps:
step S3101: a training sample set is obtained.
The training sample comprises an article corresponding to the word to be detected for training, sentence fragments, word position information of words in the sentence fragments, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the word to be detected.
The first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected.
Step S3102: and constructing a deep neural network according to a plurality of event types to be predicted.
The deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network.
The article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context-level event feature extraction sub-network is used for extracting context-level event features according to the second word vectors related to the sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction sub-network is used for acquiring first probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and a first event type vector corresponding to the event types of the first adjacent words; the second event type prediction subnetwork is used for acquiring second probability of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and a second event type vector corresponding to the event types of the second adjacent words; and the third event type prediction sub-network is used for determining the predicted value of the event type of the word to be detected according to the first probability and the second probability.
Step S3103: performing word vector embedding on the article to obtain the first word vector; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain a second word vector; and performing word position vector embedding on the word position information to obtain the word position vector.
Step S3104: and taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
As can be seen from the above embodiments, the event type prediction model construction method provided in the embodiments of the present application obtains a training sample set; the training sample comprises an article corresponding to a word to be detected for training, sentence fragments, word position information of words in the sentence fragments, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the word to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected; constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction sub-network is used for acquiring first probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and first event type vectors corresponding to the event types of the first adjacent words; the second event type prediction sub-network is configured to obtain a second probability of each event type corresponding to the word to be detected according to the article-level event feature, the context-level event feature, and a second event type vector corresponding to the event type of the second adjacent word; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability; performing word vector embedding on the article to obtain the first word vector; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain a second word vector; performing word position vector embedding on the word position information to obtain the word position vector; taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model; the processing mode combines the information of the article where the word to be detected is located, the information of the peripheral text and the event type information of the adjacent words before and after the word to be detected to construct an event type prediction model; therefore, the prediction accuracy of the event type prediction model can be effectively improved. Meanwhile, the processing mode also enables the feature of the chapter-level event to be trained together with the sample, so that more feedback with the pertinence of the event extraction task can be obtained; therefore, the prediction accuracy of the event type prediction model can be further effectively improved.
In the foregoing embodiment, an event type prediction model construction method is provided, and correspondingly, the present application also provides an event type prediction model construction device. The apparatus corresponds to an embodiment of the method described above.
Seventeenth embodiment
Please refer to fig. 32, which is a schematic diagram of an embodiment of an event type prediction model construction apparatus according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
The present application further provides an event type prediction model building apparatus, including:
a training sample obtaining unit 3201, configured to obtain a training sample set; the training sample comprises an article corresponding to a word to be detected for training, a sentence fragment, word position information of words in the sentence fragment, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the word to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected;
a network construction unit 3202, configured to construct a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction sub-network is used for acquiring first probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and first event type vectors corresponding to the event types of the first adjacent words; the second event type prediction sub-network is configured to obtain a second probability of each event type corresponding to the word to be detected according to the article-level event feature, the context-level event feature, and a second event type vector corresponding to the event type of the second adjacent word; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability;
a first word embedding unit 3203, configured to perform word vector embedding on the article to obtain the first word vector;
a first event type vector embedding unit 3204, configured to perform event type vector embedding on an event type of the first neighboring word to obtain a first event type vector;
a second event type vector embedding unit 3205, configured to perform event type vector embedding on the event type of the second neighboring word, so as to obtain a second event type vector;
a second word embedding unit 3206, configured to perform word vector embedding on the sentence fragments to obtain the second word vector;
a word position vector embedding unit 3207, configured to perform word position vector embedding on the word position information to obtain the word position vector;
a model training unit 3208, configured to use the first word vector, the first event type vector, the second word vector, and the word position vector as input data of the deep neural network, use the event type of the word to be detected as output data of the deep neural network, and train the deep neural network according to the training sample set to obtain an event type prediction model.
Eighteenth embodiment
Please refer to fig. 33, which is a diagram illustrating an embodiment of an electronic device according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the description of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
An electronic device of the present embodiment includes: a processor 3301 and a memory 3302; the memory is used for storing a program for realizing the event type prediction model building method, and after the device is powered on and runs the program for realizing the event type prediction model building method through the processor, the following steps are executed: acquiring a training sample set; the training sample comprises an article corresponding to a word to be detected for training, sentence fragments, word position information of words in the sentence fragments, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the word to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected; constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction sub-network is used for acquiring first probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and first event type vectors corresponding to the event types of the first adjacent words; the second event type prediction sub-network is configured to obtain a second probability of each event type corresponding to the word to be detected according to the article-level event feature, the context-level event feature, and a second event type vector corresponding to the event type of the second adjacent word; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability; performing word vector embedding on the article to obtain the first word vector; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain a second word vector; performing word position vector embedding on the word position information to obtain the word position vector; and taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
In the seventh embodiment, an event confirmation method is provided, and correspondingly, the present application further provides an event type prediction model construction method. The method corresponds to the embodiment of the method described above.
Nineteenth embodiment
Please refer to fig. 34, which is a flowchart illustrating an embodiment of a method for constructing an event type prediction model according to the present application, wherein an execution subject of the method includes an event type prediction model constructing apparatus. Since the method embodiment is a part of the method embodiment of the seventh embodiment, the description is relatively simple, and relevant parts can be referred to part of the description of the method embodiment. The method embodiments described below are merely illustrative.
The method for constructing the event type prediction model comprises the following steps:
step S3401: a training sample set is obtained.
The training sample comprises sentence fragments corresponding to the words to be detected for training, word position information of the words in the sentence fragments, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the words to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected.
Step S3402: and constructing a deep neural network according to a plurality of event types to be predicted.
Wherein the deep neural network comprises a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network, and a third event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction subnetwork is used for acquiring first probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and first event type vectors corresponding to the event types of the first adjacent words; the second event type prediction subnetwork is used for acquiring second probabilities of various event types corresponding to the words to be detected according to the context level event characteristics and a second event type vector corresponding to the event type of the second adjacent words; and the third event type prediction sub-network is used for determining the predicted value of the event type of the word to be detected according to the first probability and the second probability.
Step S3403: executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain the word vectors; and performing word position vector embedding on the word position information to obtain the word position vector.
Step S3404: and taking the first event type vector, the second event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
As can be seen from the above embodiments, the event type prediction model construction method provided in the embodiments of the present application obtains a training sample set; the training sample comprises sentence fragments corresponding to the words to be detected for training, word position information of the words in the sentence fragments, an event type of a first adjacent word, a corresponding relation between the event type of a second adjacent word and the event type of the words to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected; constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises a context level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction sub-network is used for acquiring first probabilities of various event types corresponding to the words to be detected according to the context level event characteristics and the first event type vector corresponding to the event type of the first adjacent word; the second event type prediction subnetwork is used for acquiring second probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and second event type vectors corresponding to the event types of the second adjacent words; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain the word vectors; performing word position vector embedding on the word position information to obtain the word position vector; taking the first event type vector, the second event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model; by the processing mode, an event type prediction model is constructed by combining the information of the text around the word to be detected and the event type information of the adjacent words before and after the word to be detected; therefore, the accuracy of event identification can be effectively improved.
In the foregoing embodiment, an event type prediction model construction method is provided, and correspondingly, the present application also provides an event type prediction model construction device. The apparatus corresponds to an embodiment of the method described above.
Twentieth embodiment
Please refer to fig. 35, which is a schematic diagram of an embodiment of an event type prediction model construction apparatus according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
The present application further provides an event type prediction model building apparatus, including:
a training sample obtaining unit 3501, configured to obtain a training sample set; the training sample comprises sentence fragments corresponding to the training words to be detected, word position information of words in the sentence fragments, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the words to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected;
a network constructing unit 3502, configured to construct a deep neural network according to the multiple event types to be predicted; wherein the deep neural network comprises a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction subnetwork is used for acquiring first probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and the first event type vectors corresponding to the event types of the first adjacent words; the second event type prediction subnetwork is used for acquiring second probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and second event type vectors corresponding to the event types of the second adjacent words; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability;
a first event type vector embedding unit 3503, configured to perform event type vector embedding on the event type of the first neighboring word, to obtain a first event type vector;
a second event type vector embedding unit 3504, configured to perform event type vector embedding on the event type of the second neighboring word, to obtain a second event type vector;
a word embedding unit 3505, configured to perform word vector embedding on the sentence fragments to obtain the word vectors;
a word position vector embedding unit 3506, configured to perform word position vector embedding on the word position information to obtain the word position vector;
a model training unit 3507, configured to use the first event type vector, the second event type vector, the word vector, and the word position vector as input data of the deep neural network, use the event type of the word to be detected as output data of the deep neural network, and train the deep neural network according to the training sample set to obtain an event type prediction model.
Twenty-first embodiment
Please refer to fig. 36, which is a diagram illustrating an embodiment of an electronic device according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the description of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
An electronic device of the present embodiment includes: a processor 3601 and a memory 3602; the memory is used for storing a program for realizing the event type prediction model building method, and after the device is powered on and runs the program for realizing the event type prediction model building method through the processor, the following steps are executed: acquiring a training sample set; the training sample comprises sentence fragments corresponding to the training words to be detected, word position information of words in the sentence fragments, event types of first adjacent words, and corresponding relations between the event types of second adjacent words and the event types of the words to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected; constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises a context level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction sub-network is used for acquiring first probabilities of various event types corresponding to the words to be detected according to the context level event characteristics and the first event type vector corresponding to the event type of the first adjacent word; the second event type prediction subnetwork is used for acquiring second probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and second event type vectors corresponding to the event types of the second adjacent words; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain the word vectors; performing word position vector embedding on the word position information to obtain the word position vector; and taking the first event type vector, the second event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
In the tenth embodiment described above, an event confirmation method is provided, and correspondingly, the present application further provides an event type prediction model construction method. The method corresponds to the embodiment of the method described above.
Twenty-second embodiment
Please refer to fig. 37, which is a flowchart illustrating an embodiment of a method for constructing an event type prediction model according to the present application, wherein an executing entity of the method includes an event type prediction model constructing apparatus. Since the method embodiment is a part of the method embodiment of the tenth embodiment, the description is relatively simple, and relevant parts can be referred to part of the description of the method embodiment. The method embodiments described below are merely illustrative.
The method for constructing the event type prediction model comprises the following steps:
step S3701: a training sample set is obtained.
The training sample comprises sentence fragments corresponding to the words to be detected for training, word position information of words in the sentence fragments, and corresponding relations between event types of adjacent words and the event types of the words to be detected; the adjacent words include at least one word occurring before or after the word to be detected.
Step S3702: and constructing a deep neural network according to a plurality of event types to be predicted.
Wherein the deep neural network comprises a context level event feature extraction sub-network and an event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; and the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the context level event characteristics and the event type vector corresponding to the event type of the adjacent word.
Step S3703: executing event type vector embedding on the event types of the adjacent words to obtain the event type vector; performing word vector embedding on the sentence fragments to obtain the word vectors; and performing word position vector embedding on the word position information to obtain the word position vector.
Step S3704: and taking the event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
As can be seen from the above embodiments, the event type prediction model construction method provided in the embodiments of the present application obtains a training sample set; the training sample comprises sentence fragments corresponding to the words to be detected for training, word position information of words in the sentence fragments, and corresponding relations between event types of adjacent words and the event types of the words to be detected; the adjacent words comprise at least one word appearing before or after the word to be detected; constructing a deep neural network according to a plurality of event types to be predicted; wherein the deep neural network comprises a context level event feature extraction sub-network and an event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the context level event characteristics and the event type vector corresponding to the event type of the adjacent word; performing event type vector embedding on the event types of the adjacent words to obtain the event type vector; performing word vector embedding on the sentence fragments to obtain the word vectors; performing word position vector embedding on the word position information to obtain the word position vector; taking the event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model; the processing mode combines the information of the text around the word to be detected and the event type information of the adjacent word before or after the word to be detected to construct an event type prediction model; therefore, the accuracy of event identification can be effectively improved.
In the foregoing embodiment, an event type prediction model construction method is provided, and correspondingly, the present application also provides an event type prediction model construction device. The apparatus corresponds to an embodiment of the method described above.
Twenty-third embodiment
Please refer to fig. 38, which is a schematic diagram of an embodiment of an event type prediction model construction apparatus according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
The present application further provides an event type prediction model building apparatus, including:
a training sample acquisition unit 3801 configured to acquire a training sample set; the training sample comprises sentence fragments corresponding to the training words to be detected, word position information of words in the sentence fragments, and corresponding relations between event types of adjacent words and the event types of the words to be detected; the adjacent words comprise at least one word appearing before or after the word to be detected;
a network construction unit 3802, configured to construct a deep neural network according to multiple event types to be predicted; wherein the deep neural network comprises a context level event feature extraction sub-network and an event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the context level event characteristics and the event type vector corresponding to the event type of the adjacent word;
an event type vector embedding unit 3803, configured to perform event type vector embedding on event types of the neighboring words to obtain the event type vector;
a word embedding unit 3804, configured to perform word vector embedding on the sentence fragments to obtain the word vectors;
a word position vector embedding unit 3805 configured to perform word position vector embedding on the word position information to obtain the word position vector;
the model training unit 3806 is configured to use the event type vector, the word vector, and the word position vector as input data of the deep neural network, use the event type of the word to be detected as output data of the deep neural network, and train the deep neural network according to the training sample set to obtain an event type prediction model.
Twenty-fourth embodiment
Please refer to fig. 39, which is a diagram illustrating an embodiment of an electronic device according to the present application. Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the description of the method embodiments for relevant points. The device embodiments described below are merely illustrative.
An electronic device of the present embodiment includes: a processor 3901 and a memory 3902; the memory is used for storing a program for realizing the event type prediction model building method, and after the device is powered on and runs the program for realizing the event type prediction model building method through the processor, the following steps are executed: acquiring a training sample set; the training sample comprises sentence fragments corresponding to the training words to be detected, word position information of words in the sentence fragments, and corresponding relations between event types of adjacent words and the event types of the words to be detected; the adjacent words comprise at least one word appearing before or after the word to be detected; constructing a deep neural network according to a plurality of event types to be predicted; wherein the deep neural network comprises a context level event feature extraction sub-network and an event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the context level event characteristics and the event type vector corresponding to the event type of the adjacent word; performing event type vector embedding on the event types of the adjacent words to obtain the event type vector; performing word vector embedding on the sentence fragments to obtain the word vectors; performing word position vector embedding on the word position information to obtain the word position vector; and taking the event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
Although the present application has been described with reference to the preferred embodiments, it is not intended to limit the present application, and any person skilled in the art can make variations and modifications without departing from the spirit and scope of the present application, therefore, the scope of the present application should be limited by the scope of the claims.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
1. Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
2. As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Claims (32)

1. An event confirmation method, comprising:
acquiring words to be detected in an article; acquiring sentence fragments corresponding to the words to be detected;
performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
taking the first word vector, the second word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network;
extracting sub-networks through the article-level event features, extracting article-level event features according to the first word vector, extracting sub-networks through the context-level event features, and extracting context-level event features according to the second word vector and the word position vector;
and acquiring a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the event characteristic at least at the article level and the event characteristic at the context level through the event type prediction sub-network.
2. The method of claim 1, further comprising:
acquiring event types respectively corresponding to at least one word appearing before or after the word to be detected as event types of adjacent words;
executing event type vector embedding on the event types of the adjacent words to obtain event type vectors;
the predicting the sub-network according to the event type, and obtaining the predicted value of the event type corresponding to the word to be detected at least according to the article-level event feature and the context-level event feature includes:
and acquiring the predicted value according to the article-level event feature, the context-level event feature and the event type vector through the event type prediction sub-network.
3. The method of claim 1,
the article level event feature extraction sub-network comprises: a sentence-level event characteristic determining sub-network, a paragraph-level event type characteristic determining sub-network and an article-level event characteristic determining sub-network;
the extracting the sub-network through the article-level event features and extracting the article-level event features according to the first word vector comprises the following steps:
determining a sub network through the sentence-level event characteristics, and acquiring sentence-level event characteristics corresponding to sentences included in the article according to the first word vector;
determining a sub network through the paragraph-level event type features, and acquiring paragraph-level event type features corresponding to paragraphs included in the article according to sentence-level event features corresponding to sentences included in the article;
and determining a sub-network through the article-level event characteristics, and acquiring the article-level event characteristics according to the paragraph-level event type characteristics.
4. The method of claim 3,
the sentence-level event characteristic determination sub-network comprises a bidirectional long-short term memory network structure Bi-LSTM;
determining a sub-network through the sentence-level event characteristics, and acquiring sentence-level event characteristics corresponding to sentences included in the article according to the first word vector, wherein the sentence-level event characteristics include:
taking the forward sequence of the first word vector related to the sentence as input data of a first LSTM, and acquiring forward sentence-level event characteristics of the sentence through the first LSTM; and taking the reverse sequence of the first word vector related to the sentence as input data of a second LSTM, and acquiring reverse sentence-level event characteristics of the sentence through the second LSTM;
and obtaining sentence-level event characteristics corresponding to sentences included in the article according to the forward sentence-level event characteristics and the reverse sentence-level event characteristics.
5. The method of claim 4,
the sentence-level event features determine that the network structure of the sub-network further comprises an attention layer;
the obtaining sentence-level event features corresponding to sentences included in the article according to the forward sentence-level event features and the reverse sentence-level event features includes:
and acquiring sentence-level event characteristics corresponding to sentences included in the article according to the forward sentence-level event characteristics and the reverse sentence-level event characteristics through the attention layer.
6. The method of claim 1, wherein the context-level event feature extraction sub-network is based on a convolutional neural network structure.
7. The method of claim 1, further comprising:
learning from a training sample set to obtain the event type prediction model;
the training samples comprise articles and sentence fragments corresponding to the words to be detected for training, and the corresponding relation between word position information corresponding to the words in the sentence fragments and event types.
8. The method of claim 7, further comprising:
acquiring event types respectively corresponding to at least one word appearing before or after the word to be detected for training, and taking the event types as event types of adjacent words for training;
the learning from the training sample set to obtain the event type prediction sub-network comprises:
and learning to obtain the event type prediction model according to the training sample set and the event types of the training adjacent words corresponding to the training words to be detected.
9. An event confirmation method, comprising:
acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before the word to be detected as event types of a first adjacent word; acquiring event types respectively corresponding to at least one word appearing after the word to be detected as event types of a second adjacent word; acquiring sentence fragments corresponding to the words to be detected;
performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network;
extracting sub-networks through the article-level event features, extracting article-level event features according to the first word vector, extracting sub-networks through the context-level event features, and extracting context-level event features according to the second word vector and the word position vector;
acquiring first probabilities of various event types corresponding to the words to be detected at least according to the article-level event features, the context-level event features and the first event type vectors through the first event type prediction sub-network; and obtaining a second probability of each event type corresponding to the word to be detected through the second event type prediction subnetwork at least according to the article-level event characteristics, the context-level event characteristics and the second event type vector;
and determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the third event type prediction sub-network and at least the first probability and the second probability.
10. An event confirmation method, comprising:
acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before the word to be detected as event types of a first adjacent word; acquiring event types respectively corresponding to at least one word appearing after the word to be detected as event types of a second adjacent word; acquiring sentence fragments corresponding to the words to be detected;
executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
taking the first event type vector, the second event type vector, the word vector, and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network, and a third event type prediction sub-network;
extracting a sub-network through the context-level event characteristics, and extracting the context-level event characteristics according to the word vectors and the word position vectors corresponding to the words in the sentence fragments;
acquiring a first probability of the word to be detected corresponding to each event type according to the context level event characteristics and the first event type vector through the first event type prediction subnetwork; acquiring a second probability of the word to be detected corresponding to each event type according to the context level event characteristics and the second event type vector through the second event type prediction sub-network;
and determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the third event type prediction sub-network and at least the first probability and the second probability.
11. An event confirmation method, comprising:
acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before or after the word to be detected as event types of adjacent words; acquiring sentence fragments corresponding to the words to be detected;
executing event type vector embedding on the event types of the adjacent words to obtain event type vectors; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
taking the event type vector, the word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises a context-level event feature extraction sub-network and an event type prediction sub-network;
Extracting a sub-network through the context-level event characteristics, and extracting the context-level event characteristics according to the word vectors and the word position vectors corresponding to the words in the sentence fragments;
and acquiring a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the event type prediction sub-network and at least the context level event characteristics and the event type vector.
12. A method for constructing an event type prediction model is characterized by comprising the following steps:
acquiring a training sample set; the training sample comprises an article corresponding to a word to be detected for training, sentence fragments, and a corresponding relation between word position information of the word in the sentence fragment and an event type;
constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the article level event characteristics and the context level event characteristics;
performing word vector embedding on the article to obtain the first word vector; performing word vector embedding on the sentence fragments to obtain a second word vector; performing word position vector embedding on the word position information to obtain the word position vector;
and taking the first word vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
13. The method of claim 12, further comprising:
acquiring event types respectively corresponding to at least one word appearing before or after the word to be detected as event types of adjacent words;
executing event type vector embedding on the event types of the adjacent words to obtain event type vectors;
the event type prediction sub-network is specifically configured to obtain the predicted value according to the article-level event feature, the context-level event feature, and the event type vector;
the input data to the deep neural network further includes the event type vector.
14. A method for constructing an event type prediction model is characterized by comprising the following steps:
acquiring a training sample set; the training sample comprises an article corresponding to a word to be detected for training, a sentence fragment, word position information of words in the sentence fragment, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the word to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected;
constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction sub-network is used for acquiring first probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and a first event type vector corresponding to the event type of the first adjacent word; the second event type prediction subnetwork is used for acquiring second probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and a second event type vector corresponding to the event types of the second adjacent words; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability;
performing word vector embedding on the article to obtain the first word vector; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain a second word vector; performing word position vector embedding on the word position information to obtain the word position vector;
and taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
15. A method for constructing an event type prediction model is characterized by comprising the following steps:
acquiring a training sample set; the training sample comprises sentence fragments corresponding to the training words to be detected, word position information of words in the sentence fragments, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the words to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected;
constructing a deep neural network according to a plurality of event types to be predicted; wherein the deep neural network comprises a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network, and a third event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction subnetwork is used for acquiring first probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and the first event type vectors corresponding to the event types of the first adjacent words; the second event type prediction subnetwork is used for acquiring second probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and second event type vectors corresponding to the event types of the second adjacent words; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability;
executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain the word vectors; performing word position vector embedding on the word position information to obtain the word position vector;
and taking the first event type vector, the second event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
16. A method for constructing an event type prediction model is characterized by comprising the following steps:
acquiring a training sample set; the training sample comprises sentence fragments corresponding to the training words to be detected, word position information of words in the sentence fragments, and corresponding relations between event types of adjacent words and the event types of the words to be detected; the adjacent words comprise at least one word appearing before or after the word to be detected;
constructing a deep neural network according to a plurality of event types to be predicted; wherein the deep neural network comprises a context level event feature extraction sub-network and an event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the context level event characteristics and the event type vector corresponding to the event type of the adjacent word;
executing event type vector embedding on the event types of the adjacent words to obtain the event type vector; performing word vector embedding on the sentence fragments to obtain the word vectors; performing word position vector embedding on the word position information to obtain the word position vector;
and taking the event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
17. An event confirmation apparatus, comprising:
the device comprises a to-be-detected word acquisition unit, a to-be-detected word acquisition unit and a to-be-detected word acquisition unit, wherein the to-be-detected word acquisition unit is used for acquiring to-be-detected words in an article;
a sentence fragment acquisition unit for acquiring a sentence fragment corresponding to the word to be detected;
the first word embedding unit is used for executing word vector embedding on the article to obtain a word vector related to the article as a first word vector;
the second word embedding unit is used for executing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors;
a word position vector embedding unit, configured to perform word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
a model input unit configured to use the first word vector, the second word vector, and the word position vector as input data of an event type prediction model, where the event type prediction model includes an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, and an event type prediction sub-network;
a first feature extraction unit, configured to extract a sub-network according to the article-level event features and extract article-level event features according to the first word vector;
a second feature extraction unit, configured to extract a sub-network according to the context-level event features, and extract context-level event features according to the second word vector and the word position vector;
and the event type prediction unit is used for acquiring a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the event type prediction sub-network at least according to the article-level event characteristic and the context-level event characteristic.
18. An event confirmation apparatus, comprising:
the device comprises a to-be-detected word acquisition unit, a to-be-detected word acquisition unit and a to-be-detected word acquisition unit, wherein the to-be-detected word acquisition unit is used for acquiring to-be-detected words in an article;
a sentence fragment acquisition unit for acquiring a sentence fragment corresponding to the word to be detected;
a first event type obtaining unit, configured to obtain event types respectively corresponding to at least one word appearing before the word to be detected, as event types of a first adjacent word;
a second event type obtaining unit, configured to obtain event types corresponding to at least one word appearing after the word to be detected, as event types of a second adjacent word;
the first word embedding unit is used for executing word vector embedding on the article to obtain a word vector related to the article as a first word vector;
the second word embedding unit is used for executing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors;
a word position vector embedding unit, configured to perform word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
a first event type vector embedding unit, configured to perform event type vector embedding on the event type of the first neighboring word to obtain a first event type vector;
a second event type vector embedding unit, configured to perform event type vector embedding on the event type of the second neighboring word to obtain a second event type vector;
a model input unit, configured to use the first word vector, the first event type vector, the second word vector, and the word position vector as input data of an event type prediction model, where the event type prediction model includes an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network, and a third event type prediction sub-network;
a first feature extraction unit, configured to extract a sub-network according to the article-level event features and extract article-level event features according to the first word vector;
a second feature extraction unit, configured to extract a sub-network according to the context-level event features, and extract context-level event features according to the second word vector and the word position vector;
a first event type prediction unit, configured to obtain, through the first event type prediction sub-network, first probabilities of various event types corresponding to the word to be detected at least according to the article-level event feature, the context-level event feature, and the first event type vector;
a second event type prediction unit, configured to obtain, by using the second event type prediction sub-network, a second probability of each event type corresponding to the word to be detected at least according to the article-level event feature, the context-level event feature, and the second event type vector;
and the event type determining unit is used for determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the third event type prediction sub-network and at least the first probability and the second probability.
19. An event confirmation apparatus, comprising:
the device comprises a to-be-detected word acquisition unit, a to-be-detected word acquisition unit and a to-be-detected word acquisition unit, wherein the to-be-detected word acquisition unit is used for acquiring to-be-detected words in an article;
a sentence fragment acquisition unit for acquiring a sentence fragment corresponding to the word to be detected;
a first event type obtaining unit, configured to obtain event types respectively corresponding to at least one word appearing before the word to be detected, as event types of a first adjacent word;
a second event type obtaining unit, configured to obtain event types corresponding to at least one word appearing after the word to be detected, as event types of a second adjacent word;
a first event type vector embedding unit, configured to perform event type vector embedding on the event type of the first neighboring word to obtain a first event type vector;
a second event type vector embedding unit, configured to perform event type vector embedding on the event type of the second neighboring word to obtain a second event type vector;
the word embedding unit is used for executing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments;
a word position vector embedding unit, configured to perform word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
a model input unit, configured to use the first event type vector, the second event type vector, the word vector, and the word position vector as input data of an event type prediction model, where the event type prediction model includes a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network, and a third event type prediction sub-network;
a feature extraction unit, configured to extract a sub-network according to the context-level event features, and extract context-level event features according to the word vectors and the word position vectors corresponding to the words in the sentence fragments;
a first event type prediction unit, configured to obtain, by using the first event type prediction subnetwork, first probabilities that the to-be-detected word corresponds to various event types at least according to the context-level event features and the first event type vector;
a second event type prediction unit, configured to obtain, by using the second event type prediction subnetwork, a second probability that the word to be detected corresponds to each event type at least according to the context-level event feature and the second event type vector;
and the event type determining unit is used for determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the third event type prediction sub-network and at least the first probability and the second probability.
20. An event confirmation apparatus, comprising:
the device comprises a to-be-detected word acquisition unit, a to-be-detected word acquisition unit and a to-be-detected word acquisition unit, wherein the to-be-detected word acquisition unit is used for acquiring to-be-detected words in an article;
a sentence fragment acquisition unit for acquiring a sentence fragment corresponding to the word to be detected;
the event type acquiring unit is used for acquiring event types corresponding to at least one word appearing before or after the word to be detected as the event types of adjacent words;
the event type vector embedding unit is used for executing event type vector embedding on the event types of the adjacent words to obtain event type vectors;
the word embedding unit is used for executing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments;
a word position vector embedding unit, configured to perform word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments;
a model input unit configured to use the event type vector, the word vector, and the word position vector as input data of an event type prediction model, where the event type prediction model includes a context-level event feature extraction sub-network and an event type prediction sub-network;
a feature extraction unit, configured to extract a sub-network according to the context-level event features, and extract context-level event features according to the word vectors and the word position vectors corresponding to the words in the sentence fragments;
and the event type prediction unit is used for acquiring a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the event type prediction sub-network and at least the context level event characteristics and the event type vector.
21. An event type prediction model construction device, comprising:
a training sample acquisition unit for acquiring a training sample set; the training sample comprises an article corresponding to a word to be detected for training, sentence fragments, and a corresponding relation between word position information of the word in the sentence fragment and an event type;
the network construction unit is used for constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the article level event characteristics and the context level event characteristics;
the first word embedding unit is used for executing word vector embedding on the article to obtain a first word vector;
the second word embedding unit is used for executing word vector embedding on the sentence fragments to obtain a second word vector;
a word position vector embedding unit configured to perform word position vector embedding on the word position information to obtain the word position vector;
and the model training unit is used for taking the first word vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
22. An event type prediction model construction device, comprising:
a training sample acquisition unit for acquiring a training sample set; the training sample comprises an article corresponding to a word to be detected for training, a sentence fragment, word position information of words in the sentence fragment, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the word to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected;
the network construction unit is used for constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction sub-network is used for acquiring first probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and a first event type vector corresponding to the event type of the first adjacent word; the second event type prediction subnetwork is used for acquiring second probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and a second event type vector corresponding to the event types of the second adjacent words; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability;
the first word embedding unit is used for executing word vector embedding on the article to obtain a first word vector;
a first event type vector embedding unit, configured to perform event type vector embedding on the event type of the first neighboring word to obtain a first event type vector;
a second event type vector embedding unit, configured to perform event type vector embedding on the event type of the second neighboring word to obtain a second event type vector;
the second word embedding unit is used for executing word vector embedding on the sentence fragments to obtain a second word vector;
a word position vector embedding unit configured to perform word position vector embedding on the word position information to obtain the word position vector;
and the model training unit is used for taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
23. An event type prediction model construction device, comprising:
a training sample acquisition unit for acquiring a training sample set; the training sample comprises sentence fragments corresponding to the training words to be detected, word position information of words in the sentence fragments, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the words to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected;
the network construction unit is used for constructing a deep neural network according to a plurality of event types to be predicted; wherein the deep neural network comprises a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network, and a third event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction subnetwork is used for acquiring first probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and the first event type vectors corresponding to the event types of the first adjacent words; the second event type prediction subnetwork is used for acquiring second probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and second event type vectors corresponding to the event types of the second adjacent words; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability;
a first event type vector embedding unit, configured to perform event type vector embedding on the event type of the first neighboring word to obtain a first event type vector;
a second event type vector embedding unit, configured to perform event type vector embedding on the event type of the second neighboring word to obtain a second event type vector;
the word embedding unit is used for executing word vector embedding on the sentence fragments to obtain the word vectors;
a word position vector embedding unit configured to perform word position vector embedding on the word position information to obtain the word position vector;
and the model training unit is used for taking the first event type vector, the second event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
24. An event type prediction model construction device, comprising:
a training sample acquisition unit for acquiring a training sample set; the training sample comprises sentence fragments corresponding to the training words to be detected, word position information of words in the sentence fragments, and corresponding relations between event types of adjacent words and the event types of the words to be detected; the adjacent words comprise at least one word appearing before or after the word to be detected;
the network construction unit is used for constructing a deep neural network according to a plurality of event types to be predicted; wherein the deep neural network comprises a context level event feature extraction sub-network and an event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the context level event characteristics and the event type vector corresponding to the event type of the adjacent word;
the event type vector embedding unit is used for executing event type vector embedding on the event types of the adjacent words to obtain the event type vector;
the word embedding unit is used for executing word vector embedding on the sentence fragments to obtain the word vectors;
a word position vector embedding unit configured to perform word position vector embedding on the word position information to obtain the word position vector;
and the model training unit is used for taking the event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
25. An electronic device, comprising:
a processor; and
a memory for storing a program for implementing the event confirmation method, wherein the following steps are executed after the device is powered on and the program for implementing the event confirmation method is executed by the processor: acquiring words to be detected in an article; acquiring sentence fragments corresponding to the words to be detected; performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the first word vector, the second word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network; extracting sub-networks through the article-level event features, extracting article-level event features according to the first word vector, extracting sub-networks through the context-level event features, and extracting context-level event features according to the second word vector and the word position vector; and acquiring a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the event characteristic at least at the article level and the event characteristic at the context level through the event type prediction sub-network.
26. An electronic device, comprising:
a processor; and
a memory for storing a program for implementing the event confirmation method, wherein the following steps are executed after the device is powered on and the program for implementing the event confirmation method is executed by the processor: acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before the word to be detected as event types of a first adjacent word; acquiring event types respectively corresponding to at least one word appearing after the word to be detected as event types of a second adjacent word; acquiring sentence fragments corresponding to the words to be detected; performing word vector embedding on the article to obtain a word vector related to the article as a first word vector; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments as second word vectors; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; extracting sub-networks through the article-level event features, extracting article-level event features according to the first word vector, extracting sub-networks through the context-level event features, and extracting context-level event features according to the second word vector and the word position vector; acquiring first probabilities of various event types corresponding to the words to be detected at least according to the article-level event features, the context-level event features and the first event type vectors through the first event type prediction sub-network; and obtaining a second probability of each event type corresponding to the word to be detected through the second event type prediction subnetwork at least according to the article-level event characteristics, the context-level event characteristics and the second event type vector; and determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the third event type prediction sub-network and at least the first probability and the second probability.
27. An electronic device, comprising:
a processor; and
a memory for storing a program for implementing the event confirmation method, wherein the following steps are executed after the device is powered on and the program for implementing the event confirmation method is executed by the processor: acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before the word to be detected as event types of a first adjacent word; acquiring event types respectively corresponding to at least one word appearing after the word to be detected as event types of a second adjacent word; acquiring sentence fragments corresponding to the words to be detected; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the first event type vector, the second event type vector, the word vector, and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network, and a third event type prediction sub-network; extracting a sub-network through the context-level event characteristics, and extracting the context-level event characteristics according to the word vectors and the word position vectors corresponding to the words in the sentence fragments; acquiring a first probability of the word to be detected corresponding to each event type according to the context level event characteristics and the first event type vector through the first event type prediction subnetwork; acquiring a second probability of the word to be detected corresponding to each event type according to the context level event characteristics and the second event type vector through the second event type prediction sub-network; and determining a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the third event type prediction sub-network and at least the first probability and the second probability.
28. An electronic device, comprising:
a processor; and
a memory for storing a program for implementing the event confirmation method, wherein the following steps are executed after the device is powered on and the program for implementing the event confirmation method is executed by the processor: acquiring words to be detected in an article; acquiring event types respectively corresponding to at least one word appearing before or after the word to be detected as event types of adjacent words; acquiring sentence fragments corresponding to the words to be detected; executing event type vector embedding on the event types of the adjacent words to obtain event type vectors; performing word vector embedding on the sentence fragments to obtain word vectors related to the sentence fragments; performing word position vector embedding on the word position information corresponding to the words in the sentence fragments to obtain word position vectors corresponding to the words in the sentence fragments; taking the event type vector, the word vector and the word position vector as input data of an event type prediction model, wherein the event type prediction model comprises a context-level event feature extraction sub-network and an event type prediction sub-network; extracting a sub-network through the context-level event characteristics, and extracting the context-level event characteristics according to the word vectors and the word position vectors corresponding to the words in the sentence fragments; and acquiring a predicted value of the event type corresponding to the word to be detected as the event type included in the article according to the event type prediction sub-network and at least the context level event characteristics and the event type vector.
29. An electronic device, comprising:
a processor; and
a memory for storing a program for implementing an event type prediction model construction method, the apparatus performing the following steps after being powered on and running the program for the event type prediction model construction method through the processor: acquiring a training sample set; the training sample comprises an article corresponding to a word to be detected for training, sentence fragments, and a corresponding relation between word position information of the word in the sentence fragment and an event type; constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network and an event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the article level event characteristics and the context level event characteristics; performing word vector embedding on the article to obtain the first word vector; performing word vector embedding on the sentence fragments to obtain a second word vector; performing word position vector embedding on the word position information to obtain the word position vector; and taking the first word vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
30. An electronic device, comprising:
a processor; and
a memory for storing a program for implementing an event type prediction model construction method, the apparatus performing the following steps after being powered on and running the program for the event type prediction model construction method through the processor: acquiring a training sample set; the training sample comprises an article corresponding to a word to be detected for training, a sentence fragment, word position information of words in the sentence fragment, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the word to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected; constructing a deep neural network according to a plurality of event types to be predicted; the deep neural network comprises an article-level event feature extraction sub-network, a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network and a third event type prediction sub-network; the article-level event feature extraction sub-network is used for extracting article-level event features according to the first word vectors related to the articles; the context level event feature extraction sub-network is used for extracting context level event features according to second word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction sub-network is used for acquiring first probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and a first event type vector corresponding to the event type of the first adjacent word; the second event type prediction subnetwork is used for acquiring second probabilities of various event types corresponding to the words to be detected according to the article-level event characteristics, the context-level event characteristics and a second event type vector corresponding to the event types of the second adjacent words; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability; performing word vector embedding on the article to obtain the first word vector; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain a second word vector; performing word position vector embedding on the word position information to obtain the word position vector; and taking the first word vector, the first event type vector, the second word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
31. An electronic device, comprising:
a processor; and
a memory for storing a program for implementing an event type prediction model construction method, the apparatus performing the following steps after being powered on and running the program for the event type prediction model construction method through the processor: acquiring a training sample set; the training sample comprises sentence fragments corresponding to the training words to be detected, word position information of words in the sentence fragments, an event type of a first adjacent word, and a corresponding relation between the event type of a second adjacent word and the event type of the words to be detected; the first adjacent word comprises at least one word appearing before the word to be detected, and the second adjacent word comprises at least one word appearing after the word to be detected; constructing a deep neural network according to a plurality of event types to be predicted; wherein the deep neural network comprises a context-level event feature extraction sub-network, a first event type prediction sub-network, a second event type prediction sub-network, and a third event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the first event type prediction subnetwork is used for acquiring first probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and the first event type vectors corresponding to the event types of the first adjacent words; the second event type prediction subnetwork is used for acquiring second probabilities of various event types corresponding to the to-be-detected words according to the context level event characteristics and second event type vectors corresponding to the event types of the second adjacent words; the third event type prediction sub-network is used for determining a predicted value of the event type of the word to be detected according to the first probability and the second probability; executing event type vector embedding on the event type of the first adjacent word to obtain a first event type vector; executing event type vector embedding on the event type of the second adjacent word to obtain a second event type vector; performing word vector embedding on the sentence fragments to obtain the word vectors; performing word position vector embedding on the word position information to obtain the word position vector; and taking the first event type vector, the second event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
32. An electronic device, comprising:
a processor; and
a memory for storing a program for implementing an event type prediction model construction method, the apparatus performing the following steps after being powered on and running the program for the event type prediction model construction method through the processor: acquiring a training sample set; the training sample comprises sentence fragments corresponding to the training words to be detected, word position information of words in the sentence fragments, and corresponding relations between event types of adjacent words and the event types of the words to be detected; the adjacent words comprise at least one word appearing before or after the word to be detected; constructing a deep neural network according to a plurality of event types to be predicted; wherein the deep neural network comprises a context level event feature extraction sub-network and an event type prediction sub-network; the context level event feature extraction sub-network is used for extracting context level event features according to word vectors related to sentence fragments and the word position vectors corresponding to the word position information; the event type prediction sub-network is used for acquiring a predicted value of the event type of the word to be detected according to the context level event characteristics and the event type vector corresponding to the event type of the adjacent word; executing event type vector embedding on the event types of the adjacent words to obtain the event type vector; performing word vector embedding on the sentence fragments to obtain the word vectors; performing word position vector embedding on the word position information to obtain the word position vector; and taking the event type vector, the word vector and the word position vector as input data of the deep neural network, taking the event type of the word to be detected as output data of the deep neural network, and training the deep neural network according to the training sample set to obtain an event type prediction model.
CN201811282309.9A 2018-10-29 2018-10-29 Event confirmation method and device and electronic equipment Active CN111104477B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811282309.9A CN111104477B (en) 2018-10-29 2018-10-29 Event confirmation method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811282309.9A CN111104477B (en) 2018-10-29 2018-10-29 Event confirmation method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111104477A true CN111104477A (en) 2020-05-05
CN111104477B CN111104477B (en) 2023-04-14

Family

ID=70420283

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811282309.9A Active CN111104477B (en) 2018-10-29 2018-10-29 Event confirmation method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111104477B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104965819A (en) * 2015-07-12 2015-10-07 大连理工大学 Biomedical event trigger word identification method based on syntactic word vector
CN105975478A (en) * 2016-04-09 2016-09-28 北京交通大学 Word vector analysis-based online article belonging event detection method and device
CN106095928A (en) * 2016-06-12 2016-11-09 国家计算机网络与信息安全管理中心 A kind of event type recognition methods and device
CN107679041A (en) * 2017-10-20 2018-02-09 苏州大学 English event synchronous anomalies method and system based on convolutional neural networks
WO2018066445A1 (en) * 2016-10-05 2018-04-12 国立研究開発法人情報通信研究機構 Causal relationship recognition apparatus and computer program therefor
WO2018111261A1 (en) * 2016-12-14 2018-06-21 Landmark Graphics Corporation Automatic classification of drilling reports with deep natural language processing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104965819A (en) * 2015-07-12 2015-10-07 大连理工大学 Biomedical event trigger word identification method based on syntactic word vector
CN105975478A (en) * 2016-04-09 2016-09-28 北京交通大学 Word vector analysis-based online article belonging event detection method and device
CN106095928A (en) * 2016-06-12 2016-11-09 国家计算机网络与信息安全管理中心 A kind of event type recognition methods and device
WO2018066445A1 (en) * 2016-10-05 2018-04-12 国立研究開発法人情報通信研究機構 Causal relationship recognition apparatus and computer program therefor
WO2018111261A1 (en) * 2016-12-14 2018-06-21 Landmark Graphics Corporation Automatic classification of drilling reports with deep natural language processing
CN107679041A (en) * 2017-10-20 2018-02-09 苏州大学 English event synchronous anomalies method and system based on convolutional neural networks

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
马晨曦: "基于递归神经网络的中文事件检测" *

Also Published As

Publication number Publication date
CN111104477B (en) 2023-04-14

Similar Documents

Publication Publication Date Title
EP3964998A1 (en) Text processing method and model training method and apparatus
KR102117160B1 (en) A text processing method and device based on ambiguous entity words
CN111581961B (en) Automatic description method for image content constructed by Chinese visual vocabulary
CN113297975A (en) Method and device for identifying table structure, storage medium and electronic equipment
CN107818085B (en) Answer selection method and system for reading understanding of reading robot
CN111090736B (en) Question-answering model training method, question-answering method, device and computer storage medium
CN108846138B (en) Question classification model construction method, device and medium fusing answer information
CN111353303B (en) Word vector construction method and device, electronic equipment and storage medium
CN113539304B (en) Video strip splitting method and device
CN113239818B (en) Table cross-modal information extraction method based on segmentation and graph convolution neural network
CN109284381B (en) Aspect perspective appreciative and detractive attitude mining method integrating expression symbol library and theme model
CN110245349A (en) A kind of syntax dependency parsing method, apparatus and a kind of electronic equipment
CN110659392B (en) Retrieval method and device, and storage medium
CN113205047A (en) Drug name identification method and device, computer equipment and storage medium
CN111104477B (en) Event confirmation method and device and electronic equipment
Toshevska et al. Exploration into deep learning text generation architectures for dense image captioning
CN114511813B (en) Video semantic description method and device
CN116975347A (en) Image generation model training method and related device
WO2023173552A1 (en) Establishment method for target detection model, application method for target detection model, and device, apparatus and medium
US20220284188A1 (en) Machine based expansion of contractions in text in digital media
CN114299525A (en) Picture processing method and device and electronic equipment
CN110852066A (en) Multi-language entity relation extraction method and system based on confrontation training mechanism
CN114840642A (en) Event extraction method, device, equipment and storage medium
KR101839121B1 (en) System and method for correcting user's query
CN114970543A (en) Semantic analysis method for crowdsourced design resources

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