An event tag detection method based on the fusion of binary classification and element knowledge model
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2026-08-14
AI Technical Summary
[0005]端到端的预训练模型方式主要的问题是可扩展性差,如果事件标签的标注 规范发生变动,每次都需要去训练语料中逐条修正该类标签的标注,且需要重 新对模型进行微调
[0024]本发明的其他有益效果将在说明书中进行进一步说明。
Smart Images

Figure CN115422353B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of natural language processing and public security management, and in particular to an event tag detection method based on the fusion of binary classification and element knowledge model. Background Technology
[0002] The development of deep neural network (DNN) models and graphics processing units (GPUs) has made it possible to train neural networks with larger parameters and more layers. Natural language sequences contain specific patterns and related knowledge, especially in vertical domains such as event texts, where these pattern features and knowledge implications are even more pronounced. Deep neural network models can effectively learn and capture these patterns and knowledge in text sequences and make predictions on previously unseen data. In recent years, the increasing sophistication of information technology in public security organs and other relevant departments has led to the accumulation of massive amounts of event text data, including police reports and incident texts, during emergency response. However, the current method for verifying daily event tags still relies primarily on manual, line-by-line checks, which is not only labor-intensive but also inefficient.
[0003] By effectively utilizing the massive amounts of accumulated event data and leveraging the capabilities of deep neural network models in sequence label classification, combined with element knowledge and rule-based post-processing, the amount of data requiring manual inspection can be significantly reduced. Ultimately, through human-machine coupling, the inspection and verification of emergency response data labels can be completed more quickly and efficiently.
[0004] In existing technologies for text sequence classification tasks, end-to-end pre-trained models, such as BERT, are mainly employed. BERT's self-attention mechanism effectively learns and captures the features inherent in the text sequence, demonstrating that a deep model can significantly improve the accuracy of natural language processing tasks. Furthermore, this model can be trained from unlabeled corpora. For the police report text labeling task, the BERT model takes the police report text sequence as input, performs word embeddings on the sequence using pre-trained parameters, and fine-tunes the model parameters through gradient descent to improve the model's generalization performance.
[0005] The main problem with end-to-end pre-trained models is their poor scalability. If the labeling standards for event tags change, it's necessary to correct the labeling of each type of tag in the training corpus each time, and the model needs to be fine-tuned again. Furthermore, pre-trained models struggle to distinguish between alerts with subtle features. The fine-tuning process is also like a black box, resulting in poor interpretability of the predicted tags and unconvincing results. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the prior art and provide an event tag detection method based on the fusion of binary classification and element knowledge model.
[0007] To achieve the above objectives, the present invention provides, in one aspect, an event label detection method based on the fusion of binary classification and element knowledge model, comprising:
[0008] The event text and its corresponding tag are concatenated to obtain the overall vector representation;
[0009] The overall vector representation is processed by the consistency judgment module to determine the correlation between the event text and the event tag, thus obtaining the second tag detection result;
[0010] The event label detection model based on element knowledge performs label detection on the event text and obtains the first label detection result;
[0011] By using grid search, the results of the first and second label detections are fused to obtain the final label detection result for the event.
[0012] In a preferred embodiment, concatenating the event text with the corresponding tag to obtain the overall vector representation includes:
[0013] The event text and its corresponding label are concatenated and processed by the BERT model to obtain the overall vector representation of the event text.
[0014] In a preferred embodiment, the step of determining the correlation between the event text and the event tag by the consistency judgment module of the overall vector representation includes:
[0015] The information indicating whether the event text matches the event label is obtained by using a fully connected layer and the softmax function.
[0016] In a preferred embodiment, the event tag detection model based on element knowledge performs tag detection on the event text to obtain a first tag detection result, including:
[0017] Coarse classification of event texts based on key features;
[0018] Perform element extraction on the event text to obtain text tag information that maps to the subcategories;
[0019] Based on rule-based filtering, and combining coarse classification results with text label information, the first label detection result of the event is determined.
[0020] In a preferred embodiment, fusing the first label detection result and the second label detection result through grid search includes:
[0021] The first label detection result and the second label detection result are weighted and summed to obtain the final label detection result.
[0022] In another aspect, the present invention provides a computer comprising a processor and a memory, the processor being configured to execute code in the memory to perform the event tag detection method based on binary classification and element knowledge model fusion as described above.
[0023] The solution provided by the embodiments of the present invention will make the event tag detection process more flexible and maintainable.
[0024] Other beneficial effects of the present invention will be further explained in the specification. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 A flowchart illustrating an event tag detection method based on the fusion of binary classification and element knowledge model, provided in an embodiment of the present invention;
[0027] Figure 2 This is a diagram illustrating the process of combining police report text with corresponding tags.
[0028] Figure 3 This is a flowchart of an event tag detection method based on element knowledge.
[0029] Figure 4 This is a diagram illustrating sequence labeling of police incident texts using the BIO method. Detailed Implementation
[0030] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Preferred embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure of the invention.
[0031] Figure 1 The flowchart illustrates an event tag detection method based on the fusion of binary classification and element knowledge model provided in an embodiment of the present invention. The method includes:
[0032] Step S101: Concatenate the event text with the corresponding tag to obtain the overall vector representation.
[0033] The process of concatenating the event text with its corresponding label to obtain the overall vector representation can be as follows: concatenate the event text with its corresponding label, and then use the BERT model to obtain the overall vector representation of the event text.
[0034] Step S102: The overall vector representation is processed by the consistency judgment module to determine the correlation between the event text and the event tag, and the second tag detection result is obtained.
[0035] The overall vector representation is processed by the consistency judgment module to determine the correlation between the event text and the event label. This can be achieved by using a fully connected layer and a softmax function to obtain information indicating whether the event text and the event label are consistent.
[0036] For example, Figure 2 The diagram illustrates how to concatenate police incident text with corresponding tags, pass it through a BERT model to obtain its overall vector representation, then pass it through a fully connected layer and perform softmax processing to obtain label scores of 0 and 1, representing that the label and text do not match, respectively. Backpropagation is then used to update the model parameters, thereby establishing the association between the event text and its corresponding tags.
[0037] Step S103: The event label detection model based on element knowledge performs label detection on the event text to obtain the first label detection result.
[0038] The event label detection model based on element knowledge mainly performs coarse classification of event text and element extraction operations to obtain the first label detection result. Its detailed implementation process will be described in detail in other embodiments below.
[0039] Step S104: By performing a grid search, the first label detection result and the second label detection result are fused to obtain the final label detection result of the event.
[0040] The process of fusing the first label detection result and the second label detection result through grid search can be specifically as follows: the first label detection result and the second label detection result are weighted and summed to obtain the final label detection result.
[0041] The embodiments of the present invention utilize a fusion model for event label detection, which can improve the model accuracy and make the judgment interpretable.
[0042] The following details a specific implementation of step S103 above.
[0043] Figure 3 A flowchart of an event label detection method based on feature knowledge is shown, including the following steps:
[0044] Step S301: Perform coarse classification of event text based on key features.
[0045] A coarse classification model can divide the event text into a second-level label system. Subsequent steps then determine the first-level labels, significantly reducing the number of labels that need to be classified. In cases where the coarse classification contains errors, these errors can be discarded through subsequent processing, improving the recall rate of erroneous data.
[0046] When event text contains a large amount of numerical information, such as ID card numbers, mobile phone numbers, bank card numbers, loss amounts, and dates, and the model is not sensitive to this information, several special tokens can be used for replacement during the data preprocessing stage. For example, in the police report event text shown in the table below, token replacement of the numerical content can further improve the recognition accuracy.
[0047] Table 1
[0048]
[0049]
[0050] Step S302: Perform element extraction on the event text to obtain text label information that is mapped to the subcategories.
[0051] In this step, feature extraction can be performed on the event text. Specifically, the event text can first be sequence-labeled, and then feature entity extraction can be performed. The BIO annotation method can be used during sequence labeling. The BERTwwm-LSTM-CRF model can be used for feature entity extraction.
[0052] Figure 4 This diagram illustrates sequence labeling of police incident texts using the BIO method.
[0053] It's important to note that after extracting elements from event text to obtain preliminary labels, label normalization is sometimes necessary to establish a mapping with subsequent subcategories. For example, "crime location" in the form of "construction site," "factory," or "business company" would be normalized to the label "unit area." Furthermore, the normalized label can be mapped to the final subcategories; here, "unit area" and the label "theft unit" are mapped. This element label normalization module can be implemented using a hash table. Additionally, an "other" category label can be defined. If "crime location" cannot be mapped to any of the other address-related labels, it will be mapped to "other," and the final predicted label will be unrelated to the address.
[0054] Step S303: Based on rule filtering, combine the coarse classification results and text label information to determine the first label detection result of the event.
[0055] Based on predefined rules, candidate labels for the next step are provided. Most of the time, a single candidate label indicates sufficient confidence in predicting that label based on the previously obtained information. For example, if the probability model label filtering module provides the label "theft," and the element normalization module provides "residential area" and a loss amount greater than 600 yuan, then the final label for this type of police incident text can be inferred to be "criminal incident -> theft -> residential theft." The rule module can be divided into affirmative and negative rules. Affirmative rules, for example, deduce a label based on feedback from previous modules; negative rules, for example, negate certain labels based on feedback. Table 2 lists some examples of affirmative and negative rules, written using a rule engine.
[0056] Table 2
[0057]
[0058] The rules for rule filtering can be stored in a configuration file, which improves the flexibility and maintainability of the rule module.
[0059] If, in step S303, based on rule filtering and combining the coarse classification results and text label information, the first label detection result of the event is determined to be greater than or equal to two labels, the event text can be further subdivided to determine the first-level label.
[0060] For example, if the rules module returns two tags in step 303, namely "SMS fraud" and "illegal SMS", the "illegal SMS" tag will be filtered out if the "police handling category" is "reporting a criminal case".
[0061] After step S303 filters based on rules and multiple label results remain, they will be further processed through model fusion in the subsequent step 103 to obtain the final label detection result.
[0062] The solution provided in this invention combines coarse model classification with post-processing rules, making the event label detection process more flexible and maintainable. For example, for data with changing labeling specifications, the secondary labels of this data often remain unchanged, so only the rule filtering module needs to be adjusted. Utilizing a rule engine can further enhance flexibility. The feature extraction module can make the inference results more convincing.
[0063] Another embodiment of the present invention provides a computer, including a processor and a memory, wherein the processor is configured to execute code in the memory to perform the event label detection method based on binary classification and element knowledge model fusion described in the above embodiments.
[0064] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable system. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center integrating one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
[0065] The various illustrative logic units and circuits described in the embodiments of this application can be implemented or operate the described functions using a general-purpose processor, digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA) or other programmable logic system, discrete gate or transistor logic, discrete hardware components, or any combination thereof. The general-purpose processor can be a microprocessor; alternatively, it can also be any conventional processor, controller, microcontroller, or state machine. The processor can also be implemented using a combination of computing systems, such as a digital signal processor and a microprocessor, multiple microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration.
[0066] The steps of the methods or algorithms described in the embodiments of this application can be directly embedded in hardware, a software unit executed by a processor, or a combination of both. The software unit can be stored in RA memory, flash memory, RO memory, EPRO memory, EEPRO memory, registers, hard disk, removable disk, CD RO, or any other form of storage medium in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and storage medium can be disposed in an ASIC, which can be disposed in a terminal. Optionally, the processor and storage medium can also be disposed in different components within the terminal. These computer program instructions can also be loaded onto a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0067] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An event tag detection method based on the fusion of binary classification and element knowledge model, characterized in that, include: The event text and its corresponding tag are concatenated to obtain the overall vector representation; The overall vector representation is processed by the consistency judgment module to determine the correlation between the event text and the event tag, and the second tag detection result is obtained. The event label detection model based on element knowledge performs label detection on the event text and obtains the first label detection result; By using grid search, the first label detection result and the second label detection result are fused to obtain the final label detection result of the event; The event tag detection model based on element knowledge performs tag detection on the event text, and the first tag detection result includes: Coarse classification of event texts based on key features; Perform element extraction on the event text to obtain text tag information that maps to the subcategories; Based on rule-based filtering, and combining coarse classification results with text label information, the first label detection result of the event is determined.
2. The method as described in claim 1, characterized in that, The process of concatenating the event text with its corresponding tag to obtain the overall vector representation includes: The event text and its corresponding label are concatenated and processed by the BERT model to obtain the overall vector representation of the event text.
3. The method as described in claim 1, characterized in that, The process of determining the correlation between the event text and the event tag by passing the overall vector representation through the consistency judgment module includes: The information indicating whether the event text matches the event label is obtained by using a fully connected layer and the softmax function.
4. The method as described in claim 1, characterized in that, The process of fusing the first label detection result and the second label detection result through grid search includes: The first label detection result and the second label detection result are weighted and summed to obtain the final label detection result.
Citation Information
Patent Citations
Knowledge graph automatic construction method and system for massive unstructured text
WO2020000848A1
Knowledge graph-based text comparison method and apparatus, device, and storage medium
WO2022022045A1