Event label detection method based on similarity and element knowledge model fusion
By integrating similarity and element knowledge models, and combining rule filtering and grid search, the scalability and interpretability issues of end-to-end pre-trained models in police text label classification are solved, achieving flexible and efficient police text label detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, end-to-end pre-trained models have poor scalability in police incident text label classification, require retraining when labeling standards change, and have poor interpretability of prediction results, making it difficult to distinguish police incidents with less obvious features.
A method based on similarity and element knowledge model fusion is adopted. The event label detection model based on element knowledge is used for coarse classification, and the results are fused by combining similarity matching module and rule filtering and grid search, which improves the flexibility and interpretability of the detection process.
It improves the accuracy and interpretability of the model, making the event label detection process more flexible and maintainable. When the labeling specifications change, only the rule filtering module needs to be adjusted.
Smart Images

Figure CN115422352B_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 similarity and element knowledge models. 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 can effectively learn and capture the features inherent in text sequences, demonstrating that a deep model can significantly improve the accuracy of natural language processing tasks. Furthermore, this model can be trained from unlabeled data corpora. For the police report text label classification task, the BERT model takes the police report text sequence as input, performs word embeddings on the sequence text 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 similarity and element knowledge model, which can improve the flexibility and maintainability of the detection process.
[0007] To achieve the above objectives, this invention provides an event tag detection method based on the fusion of similarity and element knowledge models, comprising:
[0008] The event label detection model based on element knowledge performs label detection on the event text and obtains the first label detection result;
[0009] The similarity matching module is used to perform tag detection on the event text to obtain the second tag detection result;
[0010] 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.
[0011] In a preferred embodiment, the similarity matching module is obtained by training a metric model using positive and negative examples.
[0012] In a preferred embodiment, the loss function used by the similarity matching module trained with positive and negative examples using the metric model is as follows:
[0013]
[0014] Where m is a hyperparameter, representing the degree to which positive and negative samples are distinguished; The vector is obtained by representing the event text using the model; the event text x is the training data, x + For its positive sample, x - It is a negative example sample;
[0015] The training objective of the training process is to make x score high with its positive examples and low with its negative examples, with the degree of discrimination being the hyperparameter m.
[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] Another embodiment of the present invention provides a computer, including a processor and a memory, the processor being configured to execute code in the memory to perform the event tag detection method based on similarity and element knowledge model fusion as described above.
[0023] 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.
[0024] The solution provided in this embodiment of the invention combines coarse model classification with post-processing rules, making the event label detection process more flexible and maintainable.
[0025] Other beneficial effects of the present invention will be further explained in the specification. Attached Figure Description
[0026] 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.
[0027] Figure 1 A flowchart of an event tag detection method based on the fusion of similarity and element knowledge models provided in an embodiment of the present invention;
[0028] Figure 2 The process of constructing positive and negative examples for a police report text;
[0029] Figure 3 This is a flowchart of an event tag detection method based on element knowledge.
[0030] Figure 4 This is a diagram illustrating sequence labeling of police incident texts using the BIO method. Detailed Implementation
[0031] 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.
[0032] Figure 1 The flowchart illustrates an event tag detection method based on similarity and element knowledge model fusion provided by an embodiment of the present invention. The method includes:
[0033] Step S101: The event label detection model based on element knowledge performs label detection on the event text to obtain the first label detection result.
[0034] 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.
[0035] Step S102: Use the similarity matching module to perform tag detection on the event text and obtain the second tag detection result.
[0036] The similarity matching module can be obtained by training a metric model using positive and negative examples.
[0037] During training, for a given event text dataset, one event text with the same label is randomly selected from the remaining data as a positive example, and one event text with a different label is selected as a negative example. This ensures that the original event text has a higher similarity to the positive example event text and a lower similarity to the negative example event text. For example... Figure 2 As shown, this demonstrates the process of constructing positive and negative examples for a police report text.
[0038] The loss function used in the above training model is:
[0039]
[0040] Where m is a hyperparameter, representing the degree to which positive and negative samples are distinguished. This is a vector obtained by representing the event text using the model. The event text x is the training data, x... + For its positive sample, x - The training objective is to make x score higher with its positive samples and lower with its negative samples, with the degree of discrimination being the hyperparameter m.
[0041] Step S103: 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.
[0042] 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.
[0043] 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.
[0044] The following details a specific implementation of step S101 above.
[0045] Figure 3 A flowchart of an event label detection method based on feature knowledge is shown, including the following steps:
[0046] Step S301: Perform coarse classification of event text based on key features.
[0047] 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.
[0048] 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.
[0049] Table 1
[0050] Original text The complainant, Hou** (female, 440105********3021, 181****1234), stated that between 3:00 PM and 5:53 PM on May 13, 2021, she received a call from an unknown number (0051****). The caller claimed to be a staff member of the ** flagship store and said that due to an operational error, her membership level had been upgraded, requiring her to pay a monthly membership fee. Hou then requested to cancel the membership and, following the caller's instructions, transferred money from her account (bank card: ** Bank, card number: 6216607****59974611, account holder: Hou**) to the other party's account, resulting in a loss of RMB 1,600. Preprocessed text The complainant, Ms. Hou (ID, phone number), stated that between 3:00 PM and 5:53 PM on May 13, 2021, she received a call from an unknown number (phone number). The caller claimed to be a staff member of the ** flagship store and said that due to an operational error, Ms. Hou's membership level had been upgraded, requiring her to pay a monthly membership fee. Ms. Hou then requested to cancel the membership and, following the caller's instructions, transferred money from her account (bank card: ** bank, card number: bank, account holder: Hou**) to the other party's account, resulting in a total loss of RMB [amount missing].
[0051] Step S302: Perform element extraction on the event text to obtain text label information that is mapped to the subcategories.
[0052] 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.
[0053] Figure 4 This diagram illustrates sequence labeling of police incident texts using the BIO method.
[0054] 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.
[0055] 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.
[0056] 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, derive 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.
[0057] Table 2
[0058] affirmative rule Negation rule If the initial category is "theft," the "loss amount" is greater than 600, and the "address involved" is a "residential area," then the category is "theft from a private residence." If the initial category is "extortion" and there was "no nude chat" in the police report text, then it is not "privacy extortion". If the initial category is "fraud," the "tool of the crime" is "social media," and the "amount of loss" is greater than 3000, then it is classified as "online fraud." If the initial classification tag is "assault" and there is "no physical contact" or "no fighting," then the police report text should not include "assaulting others."
[0059] The rules for rule filtering can be stored in a configuration file, which improves the flexibility and maintainability of the rule module.
[0060] 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.
[0061] 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".
[0062] 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.
[0063] 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.
[0064] 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 tag detection method based on similarity and element knowledge model fusion described in the above embodiments.
[0065] 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 that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0066] 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.
[0067] 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 apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus 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.
[0068] 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 similarity and element knowledge model, characterized in that, include: The event label detection model based on element knowledge performs label detection on the event text and obtains the first label detection result; The similarity matching module is used to perform tag detection on the event text to obtain the second tag 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 to obtain the first tag detection result, which 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; The similarity matching module is obtained by training a metric model using positive and negative examples. The loss function used in training the similarity matching module using the metric model with positive and negative examples is as follows: Where m is a hyperparameter, representing the degree to which positive and negative samples are distinguished; The vector is obtained by representing the event text using the model; the event text x is the training data, x + For its positive sample, x - It is a negative example sample; The training objective of the similarity matching module trained using a metric model with positive and negative examples is to make x score high with its positive examples and low with its negative examples, with the degree of distinction being the hyperparameter m.
2. 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.
3. A computer, characterized in that, include: A processor and a memory, the processor being configured to execute code in the memory to perform the event tag detection method based on similarity and element knowledge model fusion as described in claim 1 or 2.
Citation Information
Patent Citations
Cross-media event extraction method
CN106484767A
A fusion reasoning system and method for intelligent tags of news programs
CN109635171A