Police situation analysis method based on natural language processing and association rules
By constructing event triplets and establishing association rules based on natural language processing and association rules, the problem of inability to effectively utilize historical police information data in the existing technology is solved, the police analysis capabilities are improved, and the cause of the accident is realized. Targeted investigation and behavioral rectification.
Patent Information
- Application Number
- CN202111303071.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-04
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-11-04
AI Technical Summary
The existing technology is difficult to dig out the correlations that are helpful for police analysis and judgment from a large amount of police information, and cannot effectively use historical police data to build an analysis and early warning model.
A method based on natural language processing and association rules is used to obtain the original data of the alarm business, construct event triples and match accident factors, use the association rule mining algorithm to establish association rules, obtain frequent item sets and association rules, and then conduct Police analysis.
The police situation analysis capability of the police receiving and handling system has been improved, allowing more targeted investigation of accident causes and related behavioral rectification actions.
Smart Images

Figure CN114003683B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of alarm analysis, and in particular to an alarm analysis method based on natural language processing and association rules. Background Art
[0002] At present, a large amount of unstructured police text data is often generated in the police response business. Faced with the need to analyze the content of police reports, the existing conventional processing and analysis methods such as querying databases are difficult to extract correlations from a large amount of police information that are helpful for police analysis and judgment, and it is also impossible to effectively use historical police data to build analysis and early warning models. Summary of the invention
[0003] The present invention provides a warning analysis method based on natural language processing and association rules, which solves the problem in the related art that historical warning data cannot be effectively used for warning analysis and early warning.
[0004] As one aspect of the present invention, a method for analyzing alarm situations based on natural language processing and association rules is provided, which includes:
[0005] Obtain the original data of police call handling business;
[0006] The original data of the police reception and handling business is processed by a natural language-based tool to obtain event triples;
[0007] Matching the event triplet with the accident factor, binding the structured data in the event triplet with the accident factor, wherein the accident factor represents a mapping relationship table between the natural language of the alarm situation and the digital language of the alarm situation;
[0008] According to the association rule mining algorithm, the association rules of multiple structured data bound to each accident factor are mined to obtain a set with association rules;
[0009] The frequent item sets are processed to obtain a warning analysis result.
[0010] Furthermore, the original data of the police response and handling business includes: structured data and unstructured data, the structured data includes the police incident number, data source, police receiver, jurisdiction department, police incident type, alarm time, handling result mark, feedback person, feedback department, feedback time, police incident tracing mark and police incident verification mark; the unstructured data includes alarm content and feedback content.
[0011] Furthermore, the original data of the police reception and handling business is processed by a natural language-based tool to obtain event triples, including:
[0012] Performing reduction processing on the structured data and cleaning the unstructured data;
[0013] The unstructured data after data cleaning is segmented, POS tagged, syntactic structure described, and semantic dependency analyzed based on natural speech tools to construct event triples.
[0014] Furthermore, matching the event triplet with the accident factor and binding the structured data in the event triplet with the accident factor includes:
[0015] Classifying the accident factors according to the alarm type;
[0016] Matching the classified accident factors with the event triples one by one;
[0017] Binding the structured data in the matched event triples with the accident factors;
[0018] The above steps are repeated until the structured data in all matched event triples are bound to the accident factors.
[0019] Furthermore, the association rules are mined for the multiple structured data bound to each accident factor according to the association rule mining algorithm to obtain a set of association rules, including:
[0020] Establishing an item set to be mined for the multiple pieces of structured data bound to each accident factor, wherein the item set represents a collection of the multiple pieces of structured data bound to each accident factor;
[0021] Traversing the item set according to a preset minimum support threshold to obtain a frequent item set;
[0022] According to a preset minimum confidence threshold, the non-empty subsets of the frequent item sets are traversed to obtain a set with association rules.
[0023] Furthermore, traversing the itemsets according to a preset minimum support threshold to obtain frequent itemsets includes:
[0024] Set the minimum support threshold;
[0025] Calculate the support rate of the item set in the item set according to the support rate calculation formula;
[0026] The item set is traversed, and if the support rate of the item set of the current item set is not less than the minimum support, the item set is marked as a frequent item set.
[0027] Furthermore, the support rate calculation formula is:
[0028]
[0029] in, Represents the item set m j The support rate, Num(m j ) represents the structured data D item set m j Num(D) represents the number of tasks of structured data D;
[0030] The minimum support threshold The value range is 25% to 35%.
[0031] Furthermore, the traversing of the non-empty subset of the frequent item set according to the preset minimum confidence threshold to obtain a set with association rules includes:
[0032] Set a minimum confidence threshold;
[0033] Calculating the confidence of the item set in the item set according to the confidence calculation formula;
[0034] The non-empty subset of the frequent itemset is traversed, and if the confidence of the item set of the non-empty subset of the current frequent itemset is not less than the minimum confidence threshold, the item set is marked as a set with an association rule.
[0035] Furthermore, the confidence calculation formula is:
[0036]
[0037] Among them, m a Represents the reason in structured data D, m b represents the conclusion in structured data D, Indicates that the conclusion is drawn from the cause The confidence level, Indicates that the conclusion is drawn from the cause The support rate, Indicates the reason a Support rate;
[0038] The minimum confidence threshold value ranges from 70% to 75%.
[0039] Furthermore, the processing of the set with association rules to obtain a warning analysis result includes:
[0040] Performing attribute restoration processing on the set having association rules;
[0041] The content after attribute restoration is matched with the evaluation factor to obtain the police situation analysis conclusion and the conclusion evaluation, wherein the evaluation factor represents a mapping relationship table between the police situation analysis conclusion and the conclusion evaluation.
[0042] The police situation analysis method based on natural language processing and association rules provided by the present invention establishes association analysis between the main events of the police situation text and the historical police situation data through natural language processing tools and association rule analysis methods, can extract event triples from unstructured text information, and build association rules for different accident cause types in combination with a large amount of historical data, thereby improving the police situation analysis capability of the police receiving and handling system, and can carry out accident cause investigation and related behavior rectification actions in a more targeted manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present invention but do not constitute a limitation of the present invention. In the accompanying drawings:
[0044] Figure 1 A flowchart of the alarm analysis method based on natural language processing and association rules provided by the present invention.
[0045] Figure 2 This is a schematic diagram of the description style of the traffic accident class item set provided by the present invention. DETAILED DESCRIPTION
[0046] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0047] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present invention.
[0048] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so as to describe the embodiments of the present invention described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0049] In this embodiment, a warning analysis method based on natural language processing and association rules is provided. Figure 1 is a flow chart of a method for analyzing alarm situations based on natural language processing and association rules according to an embodiment of the present invention, such as Figure 1 As shown, including:
[0050] S110, obtaining original data of police receiving and handling services;
[0051] In an embodiment of the present invention, the collected original data of the police receiving and handling business is obtained. In order to facilitate the establishment of an association rule model, it is necessary to separate the unstructured data and the structured data, wherein the original data of the police receiving and handling business includes: structured data and unstructured data, and the structured data includes the alarm number, data source, alarm receiver, jurisdiction department, alarm type, alarm time, handling result mark, feedback person, feedback department, feedback time, alarm tracing mark and alarm verification mark; the unstructured data includes alarm content and feedback content.
[0052] For example, the content of the alarm: "Callee A received the call. The caller (phone number: 13XXXXXXXXX) said: 'My car (Su BXXXXX) was parked on the roadside next to the north gate of XX Community on Longhu Avenue. The child sitting in the back seat suddenly opened the door. Because of the rain and slippery road, a human-powered tricycle coming from behind could not brake and crashed into the door. The person on the tricycle fell to the ground and was injured. He has been sent to the hospital for treatment.' The two parties involved in the accident are currently negotiating in the hospital. They have different opinions and the police need to be dispatched."
[0053] Feedback content: "Police officer B, who was involved in the accident, reported on the scene and has negotiated and resolved the issue."
[0054] Police report number: "001100011011"
[0055] Person who received the call: "Phone Receiver A", Jurisdiction Department: "XXXXX"
[0056] Alert type: "Vehicles and non-motor vehicles"
[0057] Alarm time: "yyyy-MM-dd", disposal result mark: "1"...
[0058] S120, processing the original data of the police reception and handling service by using a natural language-based tool to obtain event triples;
[0059] In the embodiment of the present invention, it specifically includes:
[0060] Performing reduction processing on the structured data and performing data cleaning on the unstructured data;
[0061] The unstructured data after data cleaning is segmented, POS tagged, syntactic structure described, and semantic dependency analyzed based on natural speech tools to construct event triples.
[0062] When reducing the structured data, for example, the alarm traceback mark, handling result mark, alarm verification mark, etc. are set as Boolean attributes, the alarm type, data source, etc. are set as numerical attributes, and the content corresponding to the specific numerical value belongs to prior knowledge and is continuously maintained for data.
[0063] When performing data cleaning on unstructured data, for example, deleting invalid characters and text information automatically superimposed by the system that is not related to modeling, such as the name of the caller, the name of the person receiving the call, law enforcement requirements, law enforcement equipment information, etc. superimposed by the system before the description of the alarm content.
[0064] When performing word segmentation and part-of-speech tagging on unstructured data, for example, the alarm content is segmented into word sequences and each part of speech is identified, that is, verbs, nouns, pronouns, adverbs, etc. are identified.
[0065] When describing the syntactic structure of unstructured data, the dependency relationship between parts of speech is identified in the sentence, namely the subject-predicate relationship, verb-object relationship, preposition-object relationship, parallel relationship, intermolecular-object relationship, etc.
[0066] When performing semantic dependency analysis on unstructured data, construct triples of events, namely the subject, predicate and object of the event; it is worth noting that the natural language-based processing of text data can be but is not limited to using open source natural language processing toolkits.
[0067] The following triples are selected for SBV subject-predicate relationship, VOB verb-object relationship, etc.:
[0068] (‘child’, ‘open’, ‘door’) Dependency: SBV, VOB;
[0069] (‘tricycle’, ‘collision’, ‘door’) Dependency: SBV, VOB;
[0070] (‘tricycle man’, ‘fall down’, ‘on the ground’) Dependency: SBV, POB;
[0071] (‘I’, ‘sent to’, ‘hospital treatment’) Dependency: SVB, POB, VOB;
[0072] (‘both sides’, ‘yes’, ‘disagreement’) Dependency: SBV, VOB;
[0073] S130, matching the event triples with accident factors, binding the structured data in the event triples with the accident factors, wherein the accident factors represent a mapping relationship table between the natural language of the alarm situation and the digital language of the alarm situation;
[0074] In the embodiment of the present invention, the following may be specifically included:
[0075] Classifying the accident factors according to the alarm type;
[0076] Matching the classified accident factors with the event triples one by one;
[0077] Binding the structured data in the matched event triples with the accident factors;
[0078] The above steps are repeated until the structured data in all matched event triples are bound to the accident factors.
[0079] Specifically, an accident factor δ is introduced to match the event triples. In an embodiment of the present invention, the accident factor is specifically a mapping relationship table between the natural language of the alarm and the digital language of the alarm. Accident factor data is maintained based on prior knowledge. Accident factor data is also classified by alarm type. The accident factor is matched with the event triples based on the alarm type of the record. The specific matching process is that the accident factors of this category are matched with the event triples one by one. In an embodiment of the present invention, accident factor matching can avoid the problem of directly matching the specific accident type with the alarm text content, which takes too long and the text content does not have part of speech annotations, causing ambiguity. After matching, the structured information of the accident is bound to the accident factor.
[0080] Take the accident factor δ as a list type data as an example to illustrate:
[0081] The content of [opening the door, crossing the solid line, driving against the traffic, illegal parking, fleeing, crushing pedestrians, scratching pedestrians, overturning, rolling, falling off the vehicle, ..., traffic congestion] is maintained manually. After matching with the triples, the structured information of the accident is determined to be bound to the matched accident factors. After binding, the data is expanded to:
[0082] Time of the incident: "yyyy-MM-dd", location of the incident: "XXXXXX", illegal behavior "opening and closing the car door to hinder other vehicles and pedestrians from passing", whether to flee: "0", whether there is a scene "0", whether there are injuries "1", traffic conditions at the scene "unobstructed", whether the vehicle can be moved "1", type of vehicle involved "02 small car", accident type "vehicle and non-motor vehicle collision", accident factor "opening the car door"...
[0083] Repeat the above processing steps for historical data until all data are effectively bound to accident factors.
[0084] S140, mining association rules for multiple structured data bound to each accident factor according to an association rule mining algorithm to obtain a set with association rules;
[0085] In the embodiment of the present invention, it specifically includes:
[0086] Establishing an item set to be mined for the multiple pieces of structured data bound to each accident factor, wherein the item set represents a collection of the multiple pieces of structured data bound to each accident factor;
[0087] Traversing the item set according to a preset minimum support threshold to obtain a frequent item set;
[0088] According to a preset minimum confidence threshold, the non-empty subsets of the frequent item sets are traversed to obtain a set with association rules.
[0089] It should be understood that association rules are established category by category, and each accident factor corresponds to multiple bound structured data to form an item set D (at this point, the conversion of unstructured and semi-structured data to structured data has been completed).
[0090] By building an association rule mining algorithm (specifically, the Apriori algorithm can be used) model, the association rules of multiple bound structured data corresponding to each accident factor are mined. First, according to the different accident factors and accident types, the items of the item set D are also designed differently. For example, the item designs of the traffic accident and criminal security itemsets are not suitable to be the same. The traffic accident item set D trans It can be designed as but not limited to the following fields: time of the incident, location of the incident, illegal behavior, whether to flee, whether there is a scene, whether there are injuries, traffic conditions at the scene, whether the vehicle is movable, type of vehicle involved, type of personnel, type of accident, accident factor, etc. trans ={t1, t2, t3, ..., t k , t n}(k=1,2,3,..,n) where k is the number of tasks in this type of item set, denoted by k=Num(D trans ). A task t k It actually corresponds to a certain data structured police record. k m j Indicates D trans The collection of all items in t k ={m1, m2, m3, ..., m j ,} (j=1, 2, 3,..., l).
[0091] More specifically, the itemsets are traversed according to a preset minimum support threshold to obtain frequent itemsets, including:
[0092] Set the minimum support threshold;
[0093] Calculate the support rate of the item set in the item set according to the support rate calculation formula;
[0094] The item set is traversed, and if the support rate of the item set of the current item set is not less than the minimum support, the item set is marked as a frequent item set.
[0095] In an embodiment of the present invention,
[0096] The support rate calculation formula is:
[0097]
[0098] in, Represents the item set m j The support rate, Num(m j ) represents the structured data D item set m j Num(D) represents the number of tasks of structured data D;
[0099] The minimum support threshold The value range is 25% to 35%.
[0100] Use the frequent item sets obtained last time to search in sequence until all frequent item sets are obtained.
[0101] More specifically, traversing the non-empty subset of the frequent item set according to the preset minimum confidence threshold to obtain a set with association rules includes:
[0102] Set a minimum confidence threshold;
[0103] Calculating the confidence of the item set in the item set according to the confidence calculation formula;
[0104] The non-empty subset of the frequent itemset is traversed, and if the confidence of the item set of the non-empty subset of the current frequent itemset is not less than the minimum confidence threshold, the item set is marked as a set with an association rule.
[0105] In the embodiment of the present invention, the confidence calculation formula is:
[0106]
[0107] Among them, m a Represents the reason in structured data D, m b represents the conclusion in structured data D, Indicates that the conclusion is drawn from the cause The confidence level, Indicates that the conclusion is drawn from the cause The support rate, Indicates the reason a Support rate;
[0108] The minimum confidence threshold value ranges from 70% to 75%.
[0109] Specifically, the item set D trans Contains m j The number of tasks is the project set m j The number of supports is denoted as Num(m j ), then m j The support rate is the number of supports / number of tasks*100%, that is:
[0110]
[0111] Set the minimum support threshold, that is, It should be noted here that the minimum support threshold can be preset in advance. For example, the minimum support threshold can be set between 25% and 35%. Not less than Then m j Recorded as frequent itemsets.
[0112] About Itemset D trans Style description (for the sake of analysis, the time here is further discretized into the crime time period), as follows Figure 2 shown.
[0113] For item set D trans , where m a 、m b Represent the reason and conclusion respectively, and but The support rate is m a ∩m b The probability P(m a ∩m b ),Right now The concept of confidence in the Apriori algorithm is to describe the a Draw conclusions b The credibility of The confidence level is D trans The tasks include m a It also includes m b The conditional probability is:
[0114]
[0115] Set the minimum confidence threshold, i.e. Likewise, the minimum confidence threshold may also be preset in advance. For example, the minimum confidence threshold may be set between 70% and 75%.
[0116] Traverse the data item set D trans , find the condition that satisfies the calculation The frequent 1-itemset is then used to find the frequent 2-itemset until all frequent k-itemsets are found. The non-empty subset of the final frequent itemset is selected by the minimum confidence Screen again to get the final set of association rules.
[0117] For example,
[0118] Table 1 Results of searching for frequent 1-item sets
[0119] 1-item Support M1 35 M2 26 M3 48 M4 21 M5 26 M6 27 M7 29 M8 41
[0120] Table 2 Results of searching for frequent 2-item sets
[0121] 2-item Support M1, M2 15 M1, M3 13 M1, M4 26 M1, M5 12 M1, M6 11 ...... ......
[0122] S150: Process the set with association rules to obtain a warning analysis result.
[0123] Specifically, they may include:
[0124] Performing attribute restoration processing on the set having association rules;
[0125] The content after attribute restoration is matched with the evaluation factor to obtain the police situation analysis conclusion and the conclusion evaluation, wherein the evaluation factor represents a mapping relationship table between the police situation analysis conclusion and the conclusion evaluation.
[0126] It should be understood that the attribute restoration process of the set with association rules is mainly to restore the expression of digital language obtained after the previous accident factor matching, and the attribute restoration here is to restore it to natural language.
[0127] After attribute restoration, the restored content is matched with the evaluation factor. Here, the evaluation factor is a mapping relationship table, which includes a mapping relationship table between the police situation analysis conclusion and the conclusion evaluation. Therefore, by matching the restored content with the evaluation factor, the police situation analysis conclusion and the corresponding conclusion evaluation can be obtained.
[0128] For example, the data type of the evaluation factor γ is a map, the key records the conclusion, and the corresponding value is the evaluation corresponding to the conclusion, such as: reason m a:No scene, vehicle fled=》Conclusionm b : The key value of the map of the crime scene XXX Primary School (the location attribute is primary school) is: crime scene attribute-road section near the primary school (23_XXXXX Primary School, where 23 indicates that the location attribute value is the road section near the primary school), and the value corresponding to this key is "strengthen supervision around schools."
[0129] In summary, the police situation analysis method based on natural language processing and association rules provided in the embodiment of the present invention establishes association analysis between the main events of the police situation text and the historical police situation data through natural language processing tools and association rule analysis methods, can extract event triples from unstructured text information, and build association rules for different accident cause types in combination with a large amount of historical data, thereby improving the police situation analysis capability of the police receiving and handling system, and being able to carry out accident cause investigation and related behavior rectification actions in a more targeted manner.
[0130] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present invention, but the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.
Claims
1. A warning analysis method based on natural language processing and association rules, characterized in that: include: Obtain the original data of police call handling business; The original data of the police reception and handling business is processed by a natural language-based tool to obtain event triples; Matching the event triplet with the accident factor, binding the structured data in the event triplet with the accident factor, wherein the accident factor represents a mapping relationship table between the natural language of the alarm situation and the digital language of the alarm situation; According to the association rule mining algorithm, the association rules of multiple structured data bound to each accident factor are mined to obtain a set with association rules; Processing the set with association rules to obtain a warning situation analysis result; The matching of the event triplet with the accident factor and binding of the structured data in the event triplet with the accident factor includes: Classifying the accident factors according to the alarm type; Matching the classified accident factors with the event triples one by one; Binding the structured data in the matched event triples with the accident factors; Repeat the above steps until the structured data in all matched event triples are bound to the accident factors; The association rule mining algorithm is used to mine the association rules of the multiple structured data bound to each accident factor to obtain a set of association rules, including: Establishing an item set to be mined for the multiple pieces of structured data bound to each accident factor, wherein the item set represents a collection of the multiple pieces of structured data bound to each accident factor; Traversing the item set according to a preset minimum support threshold to obtain a frequent item set; Traversing the non-empty subsets of the frequent itemsets according to a preset minimum confidence threshold to obtain a set with association rules; The processing of the set with association rules to obtain the alarm analysis result includes: Performing attribute restoration processing on the set having association rules; The content after attribute restoration is matched with the evaluation factor to obtain the police situation analysis conclusion and the conclusion evaluation, wherein the evaluation factor represents a mapping relationship table between the police situation analysis conclusion and the conclusion evaluation.
2. The alarm analysis method based on natural language processing and association rules according to claim 1 is characterized in that: The original data of the police response and handling business includes: structured data and unstructured data. The structured data includes the police incident number, data source, person receiving the police incident, jurisdiction department, police incident type, alarm time, handling result mark, feedback person, feedback department, feedback time, police incident tracing mark and police incident verification mark; the unstructured data includes alarm content and feedback content.
3. The alarm analysis method based on natural language processing and association rules according to claim 2 is characterized in that: The original data of the police reception and handling business is processed by a natural language-based tool to obtain event triples, including: Performing reduction processing on the structured data and cleaning the unstructured data; The unstructured data after data cleaning is segmented, POS tagged, syntactic structure described, and semantic dependency analyzed based on natural language tools to construct event triples.
4. The alarm analysis method based on natural language processing and association rules according to claim 1 is characterized in that: The step of traversing the item set according to a preset minimum support threshold to obtain a frequent item set includes: Set the minimum support threshold; Calculate the support rate of the item set in the item set according to the support rate calculation formula; The item set is traversed, and if the support rate of the item set of the current item set is not less than the minimum support threshold, the item set is marked as a frequent item set.
5. The alarm analysis method based on natural language processing and association rules as described in claim 4 is characterized in that: The support rate calculation formula is: in, Represents the item set m j The support rate, Num(m j ) represents the structured data D item set m j Num(D) represents the number of tasks of structured data D; The minimum support threshold The value range is 25% to 35%.
6. The alarm analysis method based on natural language processing and association rules according to claim 1 is characterized in that: The step of traversing the non-empty subset of the frequent item set according to the preset minimum confidence threshold to obtain a set with association rules includes: Set a minimum confidence threshold; Calculating the confidence of the item set in the item set according to the confidence calculation formula; The non-empty subset of the frequent itemset is traversed, and if the confidence of the item set of the non-empty subset of the current frequent itemset is not less than the minimum confidence threshold, the item set is marked as a set with an association rule.
7. The method for analyzing alarm situations based on natural language processing and association rules according to claim 6 is characterized in that: The confidence calculation formula is: Among them, m a Represents the reason in structured data D, m b represents the conclusion in structured data D, Indicates that the conclusion is drawn from the cause The confidence level, Indicates that the conclusion is drawn from the cause The support rate, Indicates the reason a 's support rate; The minimum confidence threshold value ranges from 70% to 75%.
