CN116991983B - Event extraction method and system for company information text - Google Patents
Event extraction method and system for company information text Download PDFInfo
- Publication number
- CN116991983B CN116991983B CN202311259460.1A CN202311259460A CN116991983B CN 116991983 B CN116991983 B CN 116991983B CN 202311259460 A CN202311259460 A CN 202311259460A CN 116991983 B CN116991983 B CN 116991983B
- Authority
- CN
- China
- Prior art keywords
- company name
- text
- event
- company
- information text
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000605 extraction Methods 0.000 title claims abstract description 55
- 238000002372 labelling Methods 0.000 claims abstract description 33
- 238000000034 method Methods 0.000 claims description 38
- 238000012549 training Methods 0.000 claims description 28
- 230000006870 function Effects 0.000 claims description 21
- 238000012216 screening Methods 0.000 claims description 15
- 238000009826 distribution Methods 0.000 claims description 12
- 238000007781 pre-processing Methods 0.000 claims description 12
- 238000012886 linear function Methods 0.000 claims description 8
- 230000000873 masking effect Effects 0.000 claims description 8
- 238000005457 optimization Methods 0.000 claims description 8
- 238000004140 cleaning Methods 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 5
- 238000012512 characterization method Methods 0.000 claims description 4
- 238000009223 counseling Methods 0.000 claims description 4
- 239000000284 extract Substances 0.000 claims description 4
- 239000010410 layer Substances 0.000 claims description 4
- 238000007477 logistic regression Methods 0.000 claims description 4
- 238000011176 pooling Methods 0.000 claims description 4
- 239000002356 single layer Substances 0.000 claims description 4
- 238000003860 storage Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 6
- 230000006978 adaptation Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000013136 deep learning model Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3344—Query execution using natural language analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/31—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/35—Clustering; Classification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/289—Phrasal analysis, e.g. finite state techniques or chunking
- G06F40/295—Named entity recognition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Evolutionary Computation (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Machine Translation (AREA)
Abstract
The invention discloses an event extraction method and system for company information texts, wherein in an event extraction task for company information texts, a new labeling rule is provided for solving the problem of interference of noise company names to model performances, the noise company names are incorporated into a labeling system for entity identification, and event categories corresponding to the noise company names are set; the noise problem that the company name field needs to be extracted and the event type corresponding to the company name needs to be judged is converted into a simple classification problem, so that the pressure of a model is greatly relieved, and the difficulty of a task is reduced; and a two-stage extraction model of company names and event types is constructed, so that the accuracy of extracting company name fields and judging event types corresponding to the company names by the model is improved.
Description
Technical Field
The invention relates to two crossing fields of natural language processing and finance, in particular to an event extraction method and an event extraction system for company information texts.
Background
The task mode of event extraction for company information text is: extracting what happens to a company (event body) from a given information text (event type); however, a noise company name is often present in the text given by the task, that is, the company name field is only mentioned or appears in the text in the given text, and nothing happens, in the labeling system commonly used by the task, the part of company name is not labeled, and the model structure facing the task is also often influenced by the part of noise company name; at present, the model structure of the task is mainly divided into two types: 1. two-section extraction, namely extracting a company name field in a text, and judging what happens in the text in the company name; when the company name field in the task mode is extracted, the company name field in the text is accurately extracted, and whether the company name field has event types set in a labeling system or not in the context is judged, so that the accuracy of model identification and extraction is lower, and particularly satisfactory application performance cannot be achieved under the condition of few samples; 2. the method comprises the steps of jointly extracting, extracting company name fields in a text and judging the event types of the company names in a given text, wherein to a certain extent, the judgment of the event types by a model gives certain information to a company name extraction task, so that the model is helpful to judge whether the set event types occur in the given text in the company name fields to be extracted in the text, however, the problem of company name noise in the text is not solved by the model structure at the source, and a large amount of interference exists on the model in part of noise. Therefore, there is a need to address the technical challenges of how to optimize and mitigate interference with model performance from company name field noise of a set event type that does not occur in a given text.
Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to provide an event extraction method and an event extraction system for company information texts.
The technical scheme adopted for solving the technical problems is as follows:
a method for extracting event oriented to company information text comprises the following steps:
(1) Acquiring information texts facing companies, and constructing a corpus of the information texts; cleaning and preprocessing information text in a corpus;
(2) Labeling the cleaned information text according to a preset rule; performing text vectorization and label digitization on the marked information text;
(3) Constructing a two-stage event extraction model of company names and event types, training, and extracting the company names and the corresponding event types by using the trained model;
(4) Finally screening and outputting the extracted company name and the corresponding event type;
specifically, the step (1) of cleaning and preprocessing the information text in the corpus specifically includes: the operations of unifying English letters and cases, unifying Chinese and English punctuation marks, converting traditional Chinese into simplified Chinese, deleting messy codes and failing to print characters are sequentially carried out.
Further, the step (2) of labeling the cleaned information text according to a preset rule includes the following sub-steps:
(2.1) field [ com ] for labeling all company names and their abbreviations in the text of the information 1 ,com 2 ,com 3 ,…];
(2.2) according to the preset event type [ EventType ] 1 ,EventType 2 ,EventType 3 ,…,EventType n ,None,Out]Marking all event types, [ EventType ] of company name field in given information text 1 ,EventType 2 ,EventType 3 ,…,EventType n ]Indicating the event type to be extracted, n indicating a total of n event types, none indicating that no thing has occurred in the company name field in the given information text, and Out indicating that an event type other than the event type to be extracted has occurred in the company name field in the given information text.
Further, the specific fields marked with all company names and short names in the information text in the step (2.1) are as follows:
(2.1.1) acquiring an open source data set of company name strong labels, naming an entity identification data set with CLUENER fine granularity, and individually screening samples containing the company name labels in the data set; the strong annotation means that the accuracy of the annotation on the sample is more than 98%;
(2.1.2) constructing and training a BERT+Softmax company name entity extraction model, and automatically marking information texts by using the trained company name entity extraction model;
(2.1.3) obtaining an open source company noun table, and continuing to label the company name on the information text by using a forward matching algorithm and the open source company noun table;
and (2.1.4) finally, manually verifying, checking and correcting the wrongly marked company name field, and carrying out supplementary marking on the company name field which is not marked.
Further, in the step (2), text vectorization and tag digitization are performed on the labeled information text, which specifically includes: text T of information to be entered i Vectorizing to obtain X i =[x i1 ,x i2 ,x i3 ,...]The method comprises the steps of carrying out a first treatment on the surface of the Coding the location of company name in descriptive text using BIO coding rules to obtain Tag i Masking the location of each company name within the tag in the information text using the number 1 to generate each company name [ com ] i1 ,com i2 ,com i3 ,...com ik ]Relative to the information text T i Is a mask vector of (2)Generating event category labels Lab corresponding to each event main body i =[lab i1 ,lab i2 ,lab i3 ...,lab ik ]K represents the counseling text T i There are k company name fields in total, each company name field comi j There is a corresponding mask vector mi j And event category label lab ij 。
Further, in the step (3), a two-stage event extraction model of company name and event type is constructed and trained, specifically: vectorizing a representation X of an information text i Inputting a pre-training model BERT 1 Obtaining semantic representation X of information text embed,i,1 The method comprises the steps of carrying out a first treatment on the surface of the Inputting the semantic representation of the text into a Linear function Linear and a normalized exponential function Softmax of a layer in turn to obtain a predicted probability value P of whether the characters in the information text are company name fields tag,i Calculating loss value loss in fitting company name fields using cross entropy function cross sentropy com Obtaining a trained company name prediction model after back propagation and parameter optimization; vectorizing a representation X of an information text i Inputting a pre-training model BERT 2 Obtaining semantic representation X of information text embed,i,2 The method comprises the steps of carrying out a first treatment on the surface of the Traversing the mask vector m for each information text ij Using the mask vector m ij Screening a characterization vector X corresponding to a company name j in a text i embed,ij Sequentially inputting a pooling function Avgpool, a single-layer Linear function Linear and a logistic regression function Sigmoid to obtain probability distribution p of different events of company name j in text i type,ij Calculating loss value losst during prediction event type using a bi-classification cross entropy loss function BCELoss ype And carrying out back propagation and model parameter optimization to obtain a trained event type prediction model.
Further, in the step (3), the trained model is used to extract the company name and the corresponding event type, specifically: according to the two-stage event extraction model for building company name and event type and training to obtain probability value P of whether the character in the input information text is company name field ta,g And extracts the company name field [ com ] in the text of the input information i1 ,com i2 ,com i3 ,...com ik ]The method comprises the steps of carrying out a first treatment on the surface of the Masking the location of each company name obtained in the information text using the number 1 to generate each company name relative to the information text T i Is of the mask vector M i =[m i1 ,m i2 ,m i3 ,...m ik ]The method comprises the steps of carrying out a first treatment on the surface of the According to the two-stage event extraction model for constructing company name and event type and training to obtain probability distribution p of different events of each company name field in information text type,ij And extracting the event type of each company name segment in the input information text, if the event type of a certain company name field is null, the probability distribution p type,ij And if the probability of each category is smaller than 0.5, selecting the event type with the largest probability value as the predicted event type.
Further, the screening and outputting the company name and the event type extracted by the model in the step (4) specifically includes: judging whether the event type corresponding to the company name contains Out and None, if so, deleting the event type, if not, outputting the company name and the event type corresponding to the company name, and if so, deleting the company name and the event type corresponding to the company name.
Another aspect of the invention: an event extraction system for company information text, comprising: the system comprises a text database module, a text preprocessing module, a text labeling module, a text modeling module and an output module;
a text database module: acquiring and storing information texts facing to companies; the text preprocessing module is used for cleaning and preprocessing information texts in the corpus;
the text labeling module: labeling the cleaned information text according to a preset rule;
text modeling module: the method is used for text vectorization and label digitization, and builds a joint extraction model and training of company names and event types;
and an output module: the system is used for outputting the company name and event type extracted by the model;
a terminal device comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the company information text oriented event extraction method when the computer program is executed.
The beneficial effects of the invention are as follows:
1. in the event extraction method facing company information text, a new labeling rule is provided for the interference problem of noise company names on models, the noise company names are brought into the labeling rule of entity identification, corresponding labels of the noise company names are attached, and company name extraction noise which needs to be judged simultaneously for company name types and company name boundaries is converted into simple classification problems, so that model ground pressure is greatly relieved, task ground difficulty is reduced, and identification and extraction ground precision is improved;
2. in the event extraction method for the company information text, a three-section labeling method is provided, automatic labeling of a deep learning model is sequentially carried out, automatic labeling of an external word list is carried out, manual labeling and error correction flow are carried out, the machine learning method is fully utilized in labeling tasks, the workload and pressure of labeling personnel are relieved, and the labeling accuracy is improved.
3. In the event extraction method for the company information text, provided by the invention, the accuracy of event extraction in the company information text is improved by adopting a two-stage event extraction model of company names and event types in the face of the proposed labeling rules.
Drawings
FIG. 1 is a method for extracting events oriented to company information text;
FIG. 2 is a flow chart of labeling information text in an event extraction method for company information text;
FIG. 3 is a diagram showing a model structure and training flow chart in an event extraction method for company information text;
FIG. 4 is a flow chart of an event extraction system for company information text;
fig. 5 is a schematic diagram of an electronic device according to the present invention.
Detailed Description
The invention is further described below with reference to examples. The following examples are presented only to aid in the understanding of the invention. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the invention can be made without departing from the principles of the invention and these modifications and adaptations are intended to be within the scope of the invention as defined in the following claims.
The invention is further illustrated with reference to the following drawings:
example 1
Referring to fig. 1, a method for extracting event oriented to company information text includes the following steps:
step S1: acquiring information texts facing companies, and constructing a corpus of the information texts;
step S2: cleaning and preprocessing information text in a corpus;
step S3: labeling the cleaned information text according to a preset rule;
step S4: performing text vectorization and label digitization on the marked information text;
step S5: constructing a two-stage event extraction model of company names and event types, training, and extracting the company names and the corresponding event types by using the trained model;
step S6: screening and outputting the name and event type of the company extracted by the model
Further, the step S2 mainly includes: the operations of unifying English letters and cases, unifying Chinese and English punctuation marks, converting traditional Chinese into simplified Chinese, deleting messy codes and being incapable of printing characters are sequentially carried out;
further, the step S3 includes the steps of:
step S31, marking all company names and abbreviated fields [ com ] in the information text 1 ,com 2 ,com 3 ,…]The method comprises the steps of carrying out a first treatment on the surface of the According to the preset event type [ EventType ] 1 ,EventType 2 ,EventType 3 ,…,EventType n ,None,Out]Marking all event types, [ EventType ] of company name field in given information text 1 ,EventType 2 ,EventType 3 ,…,EventType n ]N represents a total of n event types, none represents that no matter occurs in the company name field in the given information text, and Out represents that event types other than the event type to be extracted occur in the company name field in the given information text;
step S32, using the example text "A company today' S fast news: a person leaves a certain department president and leaves from the company B; some stakeholders want to hold no more than 6% of the shares. For example, the noted company name fields are "company A", "department", "company B", "a plurality of" and "a rich stock", and the event types of company A department B and company A department B are None, high-level change, out, stockholder hold-down and Out respectively;
further, referring to fig. 2, the step S31 is marked with a reference numeralAll company names and short field [ com ] in information text 1 ,com 2 ,com 3 ,…]The method specifically comprises the following steps:
step S311, acquiring an open source data set of company name strong labeling, constructing a BERT+Softmax company name entity extraction model, training, and automatically labeling information text by using the constructed company name entity extraction model;
step S312, obtaining an open source company noun table, and continuing to label company names on the information text by using a forward matching algorithm and the open source company noun table;
step S313, finally, performing manual verification and correcting the company name field of the error label;
further, the step S4 mainly includes:
s41: text T of information to be entered i Vectorizing to obtain X i =[x i1 ,x i2 ,x i3 ,...]The method comprises the steps of carrying out a first treatment on the surface of the Coding the location of company name in descriptive text using BIO coding rules to obtain Tag i The method comprises the steps of carrying out a first treatment on the surface of the Masking the location of each company name within the tag in the information text using the number 1 to generate each company name [ com ] i1 ,com i2 ,com i3 ,...com ik ]Relative to the information text T i Is of the mask vector M i =[m i1 ,m i2 ,m i3 ,...m ik ]The method comprises the steps of carrying out a first treatment on the surface of the Generating event category labels Lab corresponding to each event main body i =[lab i1 ,lab i2 ,lab i3 ...,lab ik ]K represents the counseling text T i There are k company name fields in total, each company name field com ij There is a corresponding mask vector m ij And event category label lab ij ;
S42: the text "A company today's newsletter" is used as an example: a person leaves a certain department president and leaves from the company B; some stakeholders want to hold no more than 6% of the shares. "for example, text vectorization results in a one-dimensional vector of length 46 [101,4567, …,102 ]]Company name com 1 Mask vector corresponding to = "company a" is m 1 =[0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]The corresponding event type is lab 1 =[1,0,0…,0],lab 1 Is the number of preset event types.
Further, referring to fig. 3, the step S5 of constructing a two-stage event extraction model of company name and event type and training includes the following steps:
step S51: vectorizing a representation X of an information text i Inputting a pre-training model BERT 1 Obtaining semantic representation X of information text embed,i,1 ;
Step S52: inputting the semantic representation of the text into a Linear function Linear and a normalized exponential function Softmax of a layer in turn to obtain a predicted probability value P of whether the characters in the information text are company name fields tag,i ,
Step S53: calculating loss value loss in fitting company name fields using cross entropy function cross sentropy com Obtaining a trained company name prediction model after back propagation and parameter optimization;
step S54: vectorizing a representation X of an information text i Inputting a pre-training model BERT 2 Obtaining semantic representation X of information text embed,i,2 ;
Step S55: traversing the mask vector m for each information text ij Using the mask vector m ij Screening a characterization vector X corresponding to a company name j in a text i embed,ij Sequentially inputting a pooling function Avgpool, a single-layer Linear function Linear and a logistic regression function Sigmoid to obtain probability distribution p of different events of company name j in text i type,ij ;
Step S56: calculating loss value loss during prediction event type using a bi-classification cross entropy loss function BCELoss type Performing back propagation and model parameter optimization to obtain a trained event type prediction model;
further, referring to fig. 3, the step S5 of extracting the company name and the corresponding event type using the trained model includes the following steps:
step S57: according to step S51, S52, it is obtained whether the character in the text of the input information is a company name fieldProbability value P of (2) tag,i And extracts the company name field [ com ] in the text of the input information i1 ,com i2 ,com i3 ,...com ik ]The method comprises the steps of carrying out a first treatment on the surface of the Masking the location of each company name obtained in the information text using the number 1 according to step S41 to generate each company name relative to the information text T i Is of the mask vector M i =[m i1 ,m i2 ,m i3 ,...m ik ]The method comprises the steps of carrying out a first treatment on the surface of the According to step S54, S55 obtains probability distribution p of occurrence of different events in the information text for each company name field type,ij And extracting the event type of each company name segment in the input information text, if the event type of a certain company name field is null, the probability distribution p type,ij The probability of each category is smaller than 0.5, and the event type with the largest probability value is selected as the predicted event type;
further, the step S6 of screening and outputting the company name and event type extracted by the model includes: judging whether the event type corresponding to the company name contains Out and None, if so, deleting the event type, if not, outputting the company name and the event type corresponding to the company name, and if so, deleting the company name and the event type corresponding to the company name;
example two
Referring to fig. 4, an event extraction system for company information text includes: the system comprises a text database module, a text preprocessing module, a text labeling module and a text modeling module;
the text database module is used for acquiring and storing information texts facing to companies;
the text preprocessing module is used for cleaning and preprocessing information texts in the corpus;
the text labeling module is used for labeling the cleaned information text according to a preset rule;
the text modeling module is used for text vectorization and label digitization, and constructing a joint extraction model and training of company names and event types;
the output module is used for outputting the company name and event type extracted by the model.
The specific manner in which the various modules perform the operations in relation to the systems of the above embodiments have been described in detail in relation to the embodiments of the method and will not be described in detail herein.
For system embodiments, reference is made to the description of method embodiments for the relevant points, since they essentially correspond to the method embodiments. The system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purposes of the present application. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Correspondingly, the application also provides electronic equipment, which comprises: one or more processors; a memory for storing one or more programs; the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a company information text oriented event extraction method as described above. As shown in fig. 5, a hardware structure diagram of any device with data processing capability in which the system is located in the embodiment of the present invention is shown in fig. 5, and besides the processor, the memory and the network interface shown in fig. 5, any device with data processing capability in the embodiment of the present invention may further include other hardware according to the actual function of the any device with data processing capability, which is not described herein.
Accordingly, the present application also provides a computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement a company information text oriented event extraction method as described above. The computer readable storage medium may be an internal storage unit, such as a hard disk or a memory, of any of the data processing enabled devices described in any of the previous embodiments. The computer readable storage medium may also be an external storage device, such as a plug-in hard disk, a Smart Media Card (SMC), an SD Card, a Flash memory Card (Flash Card), or the like, provided on the device. Further, the computer readable storage medium may include both internal storage units and external storage devices of any device having data processing capabilities. The computer readable storage medium is used for storing the computer program and other programs and data required by the arbitrary data processing apparatus, and may also be used for temporarily storing data that has been output or is to be output.
It will be understood that the above is only one embodiment of the present invention, and that the present invention is not limited to the structure that has been described above and shown in the drawings, but that several modifications and adaptations can be made without departing from the principle of the present invention. The scope of the invention is limited only by the appended claims.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof.
Claims (3)
1. An event extraction method for company information text is characterized by comprising the following steps:
(1) Acquiring information texts facing companies, and constructing a corpus of the information texts; cleaning and preprocessing information text in a corpus; the method specifically comprises the following steps of: the operations of unifying English letters and cases, unifying Chinese and English punctuation marks, converting traditional Chinese into simplified Chinese, deleting messy codes and being incapable of printing characters are sequentially carried out;
(2) Labeling the cleaned information text according to a preset rule; performing text vectorization and label digitization on the marked information text; the method for marking the cleaned information text according to the preset rule comprises the following substeps:
(2.1) field [ com ] for labeling all company names and their abbreviations in the text of the information 1 ,com 2 ,com 3 ,…];
(2.2) according to the preset event type [ EventType ] 1 ,EventType 2 ,EventType 3 ,…,EventType n ,None,Out]Marking all event types, [ EventType ] of company name field in given information text 1 ,EventType 2 ,EventType 3 ,…,EventType n ]N represents a total of n event types, none represents that no matter occurs in the company name field in the given information text, and Out represents that event types other than the event type to be extracted occur in the company name field in the given information text;
the specific fields marked with all company names and short names in the information text in the step (2.1) are as follows:
(2.1.1) acquiring an open source data set of company name strong labels, naming an entity identification data set with CLUENER fine granularity, and individually screening samples containing the company name labels in the data set;
(2.1.2) constructing and training a BERT+Softmax company name entity extraction model, and automatically marking information texts by using the trained company name entity extraction model;
(2.1.3) obtaining an open source company noun table, and continuing to label the company name on the information text by using a forward matching algorithm and the open source company noun table;
(2.1.4) finally, manually verifying, checking and correcting the falsely marked company name field, and carrying out supplementary marking on the company name field which is not marked;
the text vectorization and label digitization operation for the marked information text comprises the following specific steps: text T of information to be entered i Proceeding withVectorization to obtain X i =[x i1 ,x i2 ,x i3 ,...]The method comprises the steps of carrying out a first treatment on the surface of the Coding the location of company name in descriptive text using BIO coding rules to obtain Tag i Masking the location of each company name within the tag in the information text using the number 1 to generate each company name [ com ] i1 ,com i2 ,com i3 ,...com ik ]Relative to the information text T i Is of the mask vector M i =[m i1 ,m i2 ,m i3 ,...m ik ]Generating event category labels Lab corresponding to each event main body i =[lab i1 ,lab i2 ,lab i3 ...,lab ik ]K represents the counseling text T i There are k company name fields in total, each company name field com ij There is a corresponding mask vector m ij And event category label lab ij ;
(3) Constructing a two-stage event extraction model of company names and event types, training, and extracting the company names and the corresponding event types by using the trained model; the method comprises the following steps of constructing a two-stage event extraction model of company names and event types and training:
(3.1) vectorizing the information text to a representation X i Inputting a pre-training model BERT 1 Obtaining semantic representation X of information text embed,i,1 ;
(3.2) inputting the semantic representation of the text into a Linear function Linear and a normalized exponential function Softmax of a layer in turn to obtain a predicted probability value P of whether the character in the information text is a company name field tag,i Calculating loss value loss in fitting company name fields using cross entropy function cross sentropy com Obtaining a trained company name prediction model after back propagation and parameter optimization;
(3.3) vectorizing the information text to a representation X i Inputting a pre-training model BERT 2 Obtaining semantic representation X of information text embed,i,2 ;
(3.4) traversing the mask vector m for each information text ij Using the mask vector m ij Screening a characterization vector X corresponding to a company name j in a text i embed,ij Sequentially inputting a pooling function Avgpool, a single-layer Linear function Linear and a logistic regression function Sigmoid to obtain probability distribution p of different events of company name j in text i type,ij Calculating loss value loss during prediction event type using a bi-classification cross entropy loss function BCELoss type Performing back propagation and model parameter optimization to obtain a trained event type prediction model;
the method comprises the steps of extracting company names and corresponding event types by using a trained model, wherein the method comprises the following steps of: according to the two-stage event extraction model for building company name and event type and training to obtain probability value P of whether the character in the input information text is company name field tag,i And extracts the company name field [ com ] in the text of the input information i1 ,com i2 ,com i3 ,...com ik ]The method comprises the steps of carrying out a first treatment on the surface of the Masking the location of each company name obtained in the information text using the number 1 to generate each company name relative to the information text T i Is of the mask vector M i =[m i1 ,m i2 ,m i3 ,...m ik ]The method comprises the steps of carrying out a first treatment on the surface of the According to the two-stage event extraction model for constructing company name and event type and training to obtain probability distribution p of different events of each company name field in information text type,ij And extracting the event type of each company name segment in the input information text, if the event type of a certain company name field is null, the probability distribution p type,ij The probability of each category is smaller than 0.5, and the event type with the largest probability value is selected as the predicted event type;
(4) Finally screening and outputting the extracted company name and the corresponding event type; the method comprises the steps of screening and outputting the company name and event type extracted by the model, and specifically comprises the following steps: judging whether the event type corresponding to the company name contains Out and None, if so, deleting the event type, if not, outputting the company name and the event type corresponding to the company name, and if so, deleting the company name and the event type corresponding to the company name.
2. A corporate information text oriented event extraction system comprising: the system comprises a text database module, a text preprocessing module, a text labeling module, a text modeling module and an output module;
a text database module: acquiring information texts facing companies, and constructing a corpus of the information texts; cleaning and preprocessing information text in a corpus; the method specifically comprises the following steps of: the operations of unifying English letters and cases, unifying Chinese and English punctuation marks, converting traditional Chinese into simplified Chinese, deleting messy codes and being incapable of printing characters are sequentially carried out;
the text labeling module: labeling the cleaned information text according to a preset rule; performing text vectorization and label digitization on the marked information text; the method for marking the cleaned information text according to the preset rule comprises the following substeps:
(2.1) field [ com ] for labeling all company names and their abbreviations in the text of the information 1 ,com 2 ,com 3 ,…];
(2.2) according to the preset event type [ EventType ] 1 ,EventType 2 ,EventType 3 ,…,EventType n ,None,Out]Marking all event types, [ EventType ] of company name field in given information text 1 ,EventType 2 ,EventType 3 ,…,EventType n ]N represents a total of n event types, none represents that no matter occurs in the company name field in the given information text, and Out represents that event types other than the event type to be extracted occur in the company name field in the given information text;
the specific fields marked with all company names and short names in the information text in the step (2.1) are as follows:
(2.1.1) acquiring an open source data set of company name strong labels, naming an entity identification data set with CLUENER fine granularity, and individually screening samples containing the company name labels in the data set;
(2.1.2) constructing and training a BERT+Softmax company name entity extraction model, and automatically marking information texts by using the trained company name entity extraction model;
(2.1.3) obtaining an open source company noun table, and continuing to label the company name on the information text by using a forward matching algorithm and the open source company noun table;
(2.1.4) finally, manually verifying, checking and correcting the falsely marked company name field, and carrying out supplementary marking on the company name field which is not marked;
the text vectorization and label digitization operation for the marked information text comprises the following specific steps: text T of information to be entered i Vectorizing to obtain X i =[x i1 ,x i2 ,x i3 ,...]The method comprises the steps of carrying out a first treatment on the surface of the Coding the location of company name in descriptive text using BIO coding rules to obtain Tag i Masking the location of each company name within the tag in the information text using the number 1 to generate each company name [ com ] i1 ,com i2 ,com i3 ,...com ik ]Relative to the information text T i Is of the mask vector M i =[m i1 ,m i2 ,m i3 ,...m ik ]Generating event category labels Lab corresponding to each event main body i =[lab i1 ,lab i2 ,lab i3 ...,lab ik ]K represents the counseling text T i There are k company name fields in total, each company name field com ij There is a corresponding mask vector m ij And event category label lab ij ;
Text modeling module: constructing a two-stage event extraction model of company names and event types, training, and extracting the company names and the corresponding event types by using the trained model; the method comprises the following steps of constructing a two-stage event extraction model of company names and event types and training:
(3.1) vectorizing the information text to a representation X i Inputting a pre-training model BERT 1 Obtaining semantic representation X of information text embed,i,1 ;
(3.2) inputting the semantic representation of the text into a Linear function Linear and a normalized exponential function Softmax of a layer in turn to obtain a predicted probability value P of whether the character in the information text is a company name field tag,i Calculating loss value loss in fitting company name fields using cross entropy function cross sentropy com Obtaining a trained company name prediction model after back propagation and parameter optimization;
(3.3) vectorizing the information text to a representation X i Inputting a pre-training model BERT 2 Obtaining semantic representation X of information text embed,i,2 ;
(3.4) traversing the mask vector m for each information text ij Using the mask vector m ij Screening a characterization vector X corresponding to a company name j in a text i embed,ij Sequentially inputting a pooling function Avgpool, a single-layer Linear function Linear and a logistic regression function Sigmoid to obtain probability distribution p of different events of company name j in text i type,ij Calculating loss value loss during prediction event type using a bi-classification cross entropy loss function BCELoss type Performing back propagation and model parameter optimization to obtain a trained event type prediction model;
the method comprises the steps of extracting company names and corresponding event types by using a trained model, wherein the method comprises the following steps of: according to the two-stage event extraction model for building company name and event type and training to obtain probability value P of whether the character in the input information text is company name field tag,i And extracts the company name field [ com ] in the text of the input information i1 ,com i2 ,com i3 ,...com ik ]The method comprises the steps of carrying out a first treatment on the surface of the Masking the location of each company name obtained in the information text using the number 1 to generate each company name relative to the information text T i Is of the mask vector M i =[m i1 ,m i2 ,m i3 ,...m ik ]The method comprises the steps of carrying out a first treatment on the surface of the According to the two-stage event extraction model for constructing company name and event type and training to obtain probability distribution p of different events of each company name field in information text type,ij And extracting the event type of each company name segment in the input information text, if the event type of a certain company name field is null, the probability distribution p type,ij The probability of each category in the list is smaller than 0.5, and then the event type with the maximum probability value is selected as the predicted event typeA shape;
and an output module: finally screening and outputting the extracted company name and the corresponding event type; the method comprises the steps of screening and outputting the company name and event type extracted by the model, and specifically comprises the following steps: judging whether the event type corresponding to the company name contains Out and None, if so, deleting the event type, if not, outputting the company name and the event type corresponding to the company name, and if so, deleting the company name and the event type corresponding to the company name.
3. A terminal device comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the company information text oriented event extraction method of claim 1 when the computer program is executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311259460.1A CN116991983B (en) | 2023-09-27 | 2023-09-27 | Event extraction method and system for company information text |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311259460.1A CN116991983B (en) | 2023-09-27 | 2023-09-27 | Event extraction method and system for company information text |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116991983A CN116991983A (en) | 2023-11-03 |
CN116991983B true CN116991983B (en) | 2024-02-02 |
Family
ID=88534216
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311259460.1A Active CN116991983B (en) | 2023-09-27 | 2023-09-27 | Event extraction method and system for company information text |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116991983B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107797993A (en) * | 2017-11-13 | 2018-03-13 | 成都蓝景信息技术有限公司 | A kind of event extraction method based on sequence labelling |
CN111985229A (en) * | 2019-05-21 | 2020-11-24 | 腾讯科技(深圳)有限公司 | Sequence labeling method and device and computer equipment |
CN113128203A (en) * | 2021-03-30 | 2021-07-16 | 北京工业大学 | Attention mechanism-based relationship extraction method, system, equipment and storage medium |
CN113159363A (en) * | 2020-12-30 | 2021-07-23 | 成都信息工程大学 | Event trend prediction method based on historical news reports |
CN113886601A (en) * | 2021-09-30 | 2022-01-04 | 武汉大学 | Electronic text event extraction method, device, equipment and storage medium |
WO2022142011A1 (en) * | 2020-12-30 | 2022-07-07 | 平安科技(深圳)有限公司 | Method and device for address recognition, computer device, and storage medium |
CN116127087A (en) * | 2022-12-06 | 2023-05-16 | 平安健康保险股份有限公司 | Knowledge graph construction method and device, electronic equipment and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9026551B2 (en) * | 2013-06-25 | 2015-05-05 | Hartford Fire Insurance Company | System and method for evaluating text to support multiple insurance applications |
-
2023
- 2023-09-27 CN CN202311259460.1A patent/CN116991983B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107797993A (en) * | 2017-11-13 | 2018-03-13 | 成都蓝景信息技术有限公司 | A kind of event extraction method based on sequence labelling |
CN111985229A (en) * | 2019-05-21 | 2020-11-24 | 腾讯科技(深圳)有限公司 | Sequence labeling method and device and computer equipment |
CN113159363A (en) * | 2020-12-30 | 2021-07-23 | 成都信息工程大学 | Event trend prediction method based on historical news reports |
WO2022142011A1 (en) * | 2020-12-30 | 2022-07-07 | 平安科技(深圳)有限公司 | Method and device for address recognition, computer device, and storage medium |
CN113128203A (en) * | 2021-03-30 | 2021-07-16 | 北京工业大学 | Attention mechanism-based relationship extraction method, system, equipment and storage medium |
CN113886601A (en) * | 2021-09-30 | 2022-01-04 | 武汉大学 | Electronic text event extraction method, device, equipment and storage medium |
CN116127087A (en) * | 2022-12-06 | 2023-05-16 | 平安健康保险股份有限公司 | Knowledge graph construction method and device, electronic equipment and storage medium |
Non-Patent Citations (2)
Title |
---|
基于LDA模型和AP聚类的主题事件抽取技术;张建恒;黄蔚;胡国超;;计算机与现代化(第12期);全文 * |
民航突发事件实体识别方法研究;王红;李浩飞;邸帅;;计算机应用与软件(第03期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN116991983A (en) | 2023-11-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11734328B2 (en) | Artificial intelligence based corpus enrichment for knowledge population and query response | |
US10402163B2 (en) | Intelligent data extraction | |
US11010673B2 (en) | Method and system for entity relationship model generation | |
EP3591539A1 (en) | Parsing unstructured information for conversion into structured data | |
CN110580308B (en) | Information auditing method and device, electronic equipment and storage medium | |
US20200125595A1 (en) | Systems and methods for parsing log files using classification and a plurality of neural networks | |
CN109086265B (en) | Semantic training method and multi-semantic word disambiguation method in short text | |
CN112434691A (en) | HS code matching and displaying method and system based on intelligent analysis and identification and storage medium | |
Singh et al. | A decision tree based word sense disambiguation system in Manipuri language | |
CN112862024B (en) | Text recognition method and system | |
CN111767390A (en) | Skill word evaluation method and device, electronic equipment and computer readable medium | |
CN111651994B (en) | Information extraction method and device, electronic equipment and storage medium | |
CN116991983B (en) | Event extraction method and system for company information text | |
CN116304023A (en) | Method, system and storage medium for extracting bidding elements based on NLP technology | |
Doughman et al. | Time-aware word embeddings for three Lebanese news archives | |
CN115294593A (en) | Image information extraction method and device, computer equipment and storage medium | |
CN114860873A (en) | Method, device and storage medium for generating text abstract | |
CN110738054B (en) | Method, system, electronic equipment and storage medium for identifying hotel information in mail | |
CN114298048A (en) | Named entity identification method and device | |
WO2021137166A1 (en) | Domain based text extraction | |
US20240135740A1 (en) | System to extract checkbox symbol and checkbox option pertaining to checkbox question from a document | |
CN114492419B (en) | Text labeling method, system and device based on newly added key words in labeling | |
CN115687334B (en) | Data quality inspection method, device, equipment and storage medium | |
DE202023105413U1 (en) | System for automated text generation with error correction | |
CN116595375A (en) | Model training method, device, equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |