Background
In the prior art, event extraction refers to extracting event information of interest to a user from a natural language text and presenting the event information in a structured form, such as what person/organization, at what time, at what place, what is done, and the information can be referred to as entity information of an event. The prior art scheme for event extraction mainly comprises the following steps: 1) and the pattern matching mode is mainly used for designing a template according to the pattern of the language and matching the sentence to be extracted with the existing template. Typically based on syntax trees or regular expressions; 2) a pipeline/pipeline-based machine learning method mainly converts tasks into multi-stage classification tasks; 3) the machine learning method based on the joint construction mode combines the extraction of trigger words and the extraction of elements in an end-to-end model mainly by converting tasks into the prediction problem of a dependency tree structure.
The above prior art methods are mainly used for extracting common events, and the methods are complicated and there is no special extraction method for emergency events. Here, the emergency event includes some emergency or sudden events, such as a fire, an earthquake, a traffic accident, and the like. Therefore, how to provide an extraction method suitable for emergency events is a problem to be solved urgently.
Disclosure of Invention
The application aims to provide a method and equipment for extracting entity information based on an emergency, so as to solve the problem that the extraction method in the prior art is too complicated.
According to an aspect of the present application, there is provided a method for extracting entity information in emergency information, wherein the method includes:
determining emergency information used for extracting entity information;
extracting candidate entity information in the emergency information, wherein the candidate entity information comprises one or more event element information used for describing the emergency information;
and performing content relation identification on the candidate entity information and the emergency information, and determining the candidate entity information meeting a content relation identification threshold value as the entity information of the emergency.
Further, the determining the emergency information for entity information extraction includes:
acquiring release information in a network platform;
and determining emergency information used for entity information extraction from the release information.
Further, the determining, from the release information, the emergency information for entity information extraction includes:
screening target release information containing emergency information trigger words from the release information;
and performing two-classification judgment on the target release information through a two-classification neural network model, and determining the target release information meeting the emergency threshold as the emergency information, wherein the two-classification neural network model is trained based on the emergency information training data.
Further, when the emergency information includes multiple types of emergency information including multiple trigger words, the training of the two-classification neural network model is completed based on multiple types of emergency information training data corresponding to the multiple types of emergency information, wherein the two-classification judgment of the target release information is performed by the two-classification neural network model, and determining the target release information meeting the emergency threshold as the emergency information includes:
and performing two-classification judgment on the target release information through a two-classification neural network model, and determining the target release information meeting the corresponding emergency threshold value as the corresponding emergency information.
Further, wherein the two-classification neural network model comprises an attention based bi-lstm model.
Further, the performing content relationship identification on the candidate entity information and the emergency information, and determining candidate entity information meeting a content relationship identification threshold as the entity information of the emergency includes:
and inputting one or more event element information corresponding to the candidate entity information and the emergency information or trigger words corresponding to the emergency information into a relation recognition neural network model, and determining the event element information meeting a content relation recognition threshold value as the entity information of the emergency.
Further, the relationship identification network model includes at least one of an attention-based rnn model and a bert model, where, when the relationship identification network model includes an attention-based rnn model and a bert model, performing content relationship identification on the candidate entity information and the emergency information, and determining candidate entity information that satisfies a content relationship identification threshold as the entity information of the emergency includes:
inputting one or more event element information corresponding to the candidate entity information and the emergency information into an attention-based rnn model and a bert model respectively, and determining the event element information meeting the content relation identification threshold of at least one model as the entity information of the emergency.
Further, the event element information of the emergency information includes subject information, time information, and location information, wherein the candidate entity information includes all the subject information, time information, and location information involved in the emergency, and the extracting the candidate entity information of the emergency information through the neural network model includes:
extracting all time information and location information in the emergency information through a ***lac tool and extracting all main body information in the emergency information through a hand tool type;
and determining all the extracted subject information, time information and location information as candidate entity information in the emergency information.
According to yet another aspect of the present application, there is also provided a computer readable medium having computer readable instructions stored thereon, the computer readable instructions being executable by a processor to implement the operations of the method as described above.
According to another aspect of the present application, there is also provided an apparatus for extracting entity information from emergency information, wherein the apparatus includes:
one or more processors; and
a memory storing computer readable instructions that, when executed, cause the processor to: determining emergency information used for extracting entity information; extracting candidate entity information in the emergency information through a neural network model, wherein the candidate entity information comprises one or more event element information used for describing the emergency information; and performing content relation identification on the candidate entity information and the emergency information, and determining the candidate entity information meeting a content relation identification threshold value as the entity information of the emergency.
Compared with the prior art, the emergency information used for extracting the entity information is determined, then the candidate entity information in the emergency information is extracted, wherein the candidate entity information comprises one or more event element information used for describing the emergency information, the content relation identification is carried out on the candidate entity information and the emergency information, and the candidate entity information meeting the content relation identification threshold value is determined as the entity information of the emergency. By the method, the entity information in the emergency information can be conveniently and quickly extracted, the efficiency is improved, and due to the separation of the steps, the rule optimization can be performed aiming at the middle step, so that the method is flexible and convenient.
Detailed Description
The present application is described in further detail below with reference to the attached figures.
In a typical configuration of the present application, the terminal, the device serving the network, and the trusted party each include 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.
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.
To further illustrate the technical means and effects adopted by the present application, the following description clearly and completely describes the technical solution of the present application with reference to the accompanying drawings and preferred embodiments.
Fig. 1 shows a flowchart of a method for extracting entity information in emergency information, which is performed by a device 1 and includes the following steps:
s11 device 1 determines emergency information for entity information extraction;
s12 the device 1 extracts candidate entity information in the emergency information, wherein the candidate entity information includes one or more event element information describing the emergency information;
s13, the device 1 identifies the content relationship between the candidate entity information and the emergency information, and determines the candidate entity information meeting the content relationship identification threshold as the entity information of the emergency.
In the present application, the method is performed by a device 1, the device 1 includes, but is not limited to, a network device, wherein the network device includes, but is not limited to, a computer device and/or a cloud, the computer device includes, but is not limited to, a personal computer, a notebook computer, an industrial computer, a network host, a single network server, a plurality of network server sets; the Cloud is made up of a large number of computers or web servers based on Cloud Computing (Cloud Computing), which is a type of distributed Computing, a virtual supercomputer consisting of a collection of loosely coupled computers. The computer device and/or cloud are merely examples, and other existing or future devices and/or resource sharing platforms, as applicable to the present application, are also intended to be included within the scope of the present application and are hereby incorporated by reference.
In this embodiment, in the step S11, the device 1 determines the emergency information used for entity information extraction. The emergency information may be selected by the user or may be automatically selected by the device 1. Here, the manner of determining the emergency information is not limited.
Preferably, wherein the step S11 includes: s111 (not shown) acquiring the release information in the network platform; s112 (not shown) determines emergency information for entity information extraction from the release information.
In this embodiment, in the step S111, the device 1 acquires the publishing information in the network platform, where the network platform includes, but is not limited to, all network platforms that can publish information, for example, but not limited to, a microblog, a wechat, or other network platforms that can publish information, and a specific network platform is not limited in this application. The issuing information is information issued by the platform account through the platform. Specifically, the device 1 may obtain the release information in real time, for example, obtain data in real time through Flink, or obtain the release information of all the account numbers of the platform from the network platform based on a preset time interval, where, in order to extract the release information better and more timely, the preset time interval may be set as small as possible, and the setting of the specific time interval may be determined based on an empirical value, which is not limited herein.
In step S112, the device 1 determines the emergency information for entity information extraction from the release information. Here, the device 1 may filter the release information by extracting the emergency key word, so as to determine the emergency information from the release information. For example, the emergency event includes one or more of a fire, an earthquake, a traffic accident, a typhoon, a flood, an epidemic situation, a civil life, etc., and when a keyword related to the fire is extracted from the distribution information, the distribution information can be determined as fire emergency event information, where the emergency event or the emergency keyword can be preset by a user.
Preferably, the emergency information used for entity information extraction can also be determined from the published information through a neural network model. Wherein the step S112 includes: screening target release information containing emergency information trigger words from the release information; and performing two-classification judgment on the target release information through a two-classification neural network model, and determining the target release information meeting an emergency threshold as the emergency information, wherein the two-classification neural network model is trained and completed based on emergency information training data, and the training data can comprise a training set and a test set, wherein the training set is used for training the neural network, and the test set is used for verifying the accuracy of the training.
In this embodiment, the target release information including the emergency information trigger word may be first screened out from the release information, where the emergency information trigger word includes related words for screening the emergency information, for example, the trigger word of the fire emergency may be fire, fire fighting, etc., where the determination of the trigger word may be determined according to the description related words corresponding to the emergency, where the emergency information trigger word may be predetermined, and then the release information including the trigger word may be screened out according to the trigger word, and the release information including the trigger word may be determined as the target release information.
And further, inputting the target release information into a two-classification neural network model for two-classification judgment, and determining the target release information meeting the emergency threshold value as the emergency information. Here, the two-class neural network model is trained based on the emergency information training data. For example, a certain amount of emergency information may be collected in advance, and the information may be used as emergency information training data to continue training the two-class neural network model until the model converges, for example, convergence may be determined by verifying accuracy of a test set in the training data to a preset value, where the preset value may be preset. For example, the emergency event includes a fire event, emergency event information and non-fire information about the fire may be collected and labeled, and then the emergency event information and the non-fire information about the fire may be input into the two-class neural network model for training until the determination result satisfies the training threshold.
Preferably, when the emergency information includes multiple types of emergency information including multiple trigger words, the training of the two-classification neural network model is completed based on multiple types of emergency information training data corresponding to the multiple types of emergency information, wherein the performing, by the two-classification neural network model, two-classification judgment on the target release information determines that the target release information meeting the emergency threshold value is the emergency information includes:
and performing two-classification judgment on the target release information through a two-classification neural network model, and determining the target release information meeting the corresponding emergency threshold value as the corresponding emergency information.
In this embodiment, if there are multiple types of emergency information, the two-classification neural network model may be trained respectively for different types of emergency information, so that the two-classification neural network model may screen out different types of emergency information. Preferably, wherein the two-classification neural network model comprises an attention based bi-lstm model.
Continuing in this embodiment, in step S12, the device 1 extracts candidate entity information in the emergency information, wherein the candidate entity information includes one or more event element information describing the emergency information. Here, the event element information may be used to summarize the emergency information, for example, the event element information may include a trigger word of the emergency or include, but is not limited to, body information, time information, and location information of the emergency, and the like. For example, for a fire emergency, the subject information may include a fire occurrence subject, such as a vegetable market, a car, a civil house, and the like.
Here, the candidate entity information corresponds to the event element information, for example, if the event element information includes time information, the candidate entity information includes all time information mentioned in the screened release information as the emergency information; if the event element information includes location information, all location information mentioned in the release information that is screened out as the emergency information, and the like. For example, the event element information includes body information, time information, and location information, and the candidate entity information includes all the body information, time information, and location information mentioned in the screened distribution information as the emergency information. Here, the event element information or the candidate entity information is only an example, and other related information as applicable to the present application should be included in the scope of the present application.
Preferably, the event element information of the emergency information includes subject information, time information, and location information, wherein the candidate entity information includes all the subject information, time information, and location information involved in the emergency, and the extracting the candidate entity information of the emergency information through a neural network model includes:
extracting all time information and location information in the emergency information through a ***ac tool and extracting all main body information in the emergency information through a hand tool;
and determining all the extracted subject information, time information and location information as candidate entity information in the emergency information.
In this embodiment, extraction of time information, location information, and the like can be performed by the ***lac tool; performing dependency syntactic analysis by a hanlp tool to extract a subject of an event trigger, taking a fire as an example, when dependency analysis is performed by the hanlp, extracting subjects of predicates of the trigger besides the subject of the trigger, for example, a building gives off dense smoke, and the dependency logic is dense smoke-guest relationship-give off + building-subject relationship-give off; and simultaneously extracting the object of the fire trigger word, such as the building on fire, wherein the dependency relationship is building-moving guest relationship-on fire.
Continuing in this embodiment, in step S13, the device 1 performs content relationship identification on the candidate entity information and the emergency information, and determines candidate entity information meeting a content relationship identification threshold as the entity information of the emergency.
In this embodiment, since the candidate entity information includes all the event element information and there may be only one event element information of the emergency, for example, the candidate entity information includes all the location information in the screened release information as the emergency information, and there is only one location information of the emergency, so that it is necessary to screen out the real location information, all the location information and the screened release information as the emergency information may be respectively subjected to content relationship identification, and the location information satisfying the content relationship identification threshold value may be determined as the location information of the emergency.
Preferably, wherein the step S13 includes: and inputting one or more event element information corresponding to the candidate entity information and the emergency information or trigger words corresponding to the emergency information into a relation recognition neural network model, and determining the event element information meeting a content relation recognition threshold value as the entity information of the emergency.
In this embodiment, for example, if the event element information includes body information, time information, and location information, when determining the body information of an emergency, all the body information may be determined by the trigger word input relationship recognition network model corresponding to the emergency information or the emergency information, respectively, to determine the body information corresponding to the emergency information; when the time information of the emergency is determined, all the time information is judged by a trigger word input relation recognition network model corresponding to the emergency information or the emergency information respectively so as to determine the time information corresponding to the emergency information and the like. For example, if all the body information and the emergency information or the trigger word corresponding to the emergency information are input, the subject corresponding to the trigger word may be used as the body information of the emergency, and the manner of determining the entity information of the emergency is only an example, and other existing or future manners that may occur, such as applying to the present application, should also be included in the scope of protection of the present application, and are herein incorporated by reference.
Preferably, the relationship recognition network model includes at least one of an attention-based rnn model and a bert model, wherein when the relationship recognition network model includes an attention-based rnn model and a bert model, the step S13 includes:
inputting one or more event element information corresponding to the candidate entity information and the emergency information into an attention-based rnn model and a bert model respectively, and determining the event element information meeting the content relation identification threshold of at least one model as the entity information of the emergency.
In this embodiment, relationship recognition may be performed by one or both relationship recognition network models to determine corresponding entity information. For example, the event element information meeting the content relationship identification threshold may be determined as the entity information of the emergency event through identification by an attention-based rnn model or a bert model alone.
Or, the judgment may be performed through an attention-based rnn model and a bert model, and the judgment of the final result is performed through an or relationship between the attention-based rnn model and the bert model, for example, if one model judges that one of the subject information is the subject information of the emergency, it may be determined that the subject information is the subject information of the emergency, and if both models judge that the subject information is not the subject information of the emergency, it may be determined that the subject information is not the subject information of the emergency. FIG. 2 shows an architecture diagram of an attention-based rnn model.
Here, the two models may be identified by the relationship of "and" in addition to the relationship of "or", and may be set in advance, and the present application is not particularly limited.
Compared with the prior art, the emergency information used for extracting the entity information is determined, then the candidate entity information in the emergency information is extracted through the neural network model, wherein the candidate entity information comprises one or more event element information used for describing the emergency information, the content relation between the candidate entity information and the emergency information is identified, and the candidate entity information meeting the content relation identification threshold value is determined as the entity information of the emergency. By the method, the entity information in the emergency information can be conveniently and quickly extracted, and the efficiency is improved.
Fig. 3 is a schematic diagram of an apparatus for extracting entity information of an emergency event according to another aspect of the present application, where the apparatus 1 includes:
a first means 11, configured to determine emergency information used for entity information extraction;
a second device 12, configured to extract candidate entity information in the emergency information, where the candidate entity information includes one or more event element information used to describe the emergency information;
and a third device 13, configured to perform content relationship identification on the candidate entity information and the emergency information, and determine candidate entity information that meets a content relationship identification threshold as the entity information of the emergency.
Furthermore, the embodiment of the present application also provides a computer readable medium, on which computer readable instructions are stored, and the computer readable instructions can be executed by a processor to implement the foregoing method.
The embodiment of the present application further provides an apparatus for extracting entity information of an emergency event, where the apparatus includes:
one or more processors; and
a memory storing computer readable instructions that, when executed, cause the processor to perform the operations of the foregoing method.
For example, the computer readable instructions, when executed, cause the one or more processors to: determining emergency information used for extracting entity information; extracting candidate entity information in the emergency information, wherein the candidate entity information comprises one or more event element information used for describing the emergency information; and performing content relation identification on the candidate entity information and the emergency information, and determining the candidate entity information meeting a content relation identification threshold value as the entity information of the emergency.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.