Event identification method, device, computer equipment and storage medium
By identifying and clustering the subjects and addresses involved in text data, the problem of difficulty in accurately identifying similar events in the prior art is solved, and efficient identification and precise classification of text data is achieved.
Patent Information
- Application Number
- CN202411889927.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-08
AI Technical Summary
It is difficult to accurately identify similar events in text data, especially when text data involves diverse expressions, it is impossible to effectively identify different text data.
By obtaining the text data to be identified, identifying and determining the subject and the address involved, clustering based on this information, forming an initial subject event cluster and an initial address event cluster, and further determining the target object event cluster through similarity clustering.
It realizes accurate identification of text data, improves the recognition accuracy of similar events, and can effectively handle a variety of application scenarios including user service scenarios.
Smart Images

Figure CN119782539A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data analysis technology, and in particular to an event recognition method, device, computer equipment and storage medium. Background Art
[0002] With the development of data analysis technology, various application scenarios need to identify and archive similar events in the obtained massive text data, so as to process the massive text data according to different similar events and improve data processing efficiency. For example, in the user service scenario, in order to efficiently process the text data of user feedback received within a period of time in the user work order management system, it is necessary to identify and archive similar events in the text data, so as to process the massive text data according to different similar events, avoid repeated processing of text data, and improve data processing efficiency. Among them, similar events refer to the same type of events involved in multiple text data. For example, in the user service scenario, if the text data of multiple user feedback are complaints about the same product, then the multiple text data of complaints about the same product are the same similar event.
[0003] In the prior art, the methods for identifying text data and determining similar events are mostly keyword recognition, pattern recognition, and simple text classification. However, when the text data involves a variety of expressions (for example, fuzzy descriptions or short texts), the existing text data recognition methods often perform poorly and cannot accurately identify different text data, and thus cannot accurately identify similar events corresponding to the text data. Therefore, how to accurately identify text data to accurately identify similar events corresponding to the text data is a technical problem that needs to be solved at present. Summary of the invention
[0004] The embodiments of the present invention provide an event recognition method, apparatus, computer device and storage medium to solve the problem of how to accurately recognize text data so as to accurately recognize similar events corresponding to the text data.
[0005] An event recognition method, comprising: Obtain multiple text data to be recognized; Identify multiple text data to be identified, and determine the subject and address involved corresponding to each of the text data to be identified; Based on the involved subjects corresponding to the multiple text data to be identified, clustering all the text data to be identified to determine at least one initial subject event cluster; Based on the addresses involved corresponding to the multiple text data to be identified, clustering all the text data to be identified to determine at least one initial address event cluster; Similarity clustering is performed on a plurality of to-be-recognized text data corresponding to each initial object event cluster to determine a target object event cluster corresponding to each initial object event cluster, wherein the initial object event cluster includes the initial subject event cluster and the initial address event cluster.
[0006] Preferably, the step of identifying a plurality of text data to be identified and determining a subject involved and an address involved corresponding to each of the text data to be identified includes: Use the pre-trained target recognition model to recognize multiple text data to be recognized, and obtain the recognition results corresponding to the target format; A preset extraction algorithm is used to extract the recognition results corresponding to each of the target formats, and the subject involved and the address involved corresponding to each of the text data to be identified are determined.
[0007] Preferably, clustering all the text data to be identified based on the involved subjects corresponding to the multiple text data to be identified to determine at least one initial subject event cluster includes: Analyze and process the involved entities corresponding to the plurality of text data to be identified respectively, and determine the abbreviation of the entity corresponding to each of the text data to be identified; Based on the subject abbreviation corresponding to each piece of text data to be recognized, the text data to be recognized are clustered to determine at least one initial subject event cluster.
[0008] Preferably, the analyzing and processing the involved entities corresponding to the plurality of text data to be identified respectively to determine the abbreviation of the entity corresponding to each text data to be identified includes: If the subject concerned satisfies the mapping rule corresponding to the abbreviation rule base, the abbreviation generation process is performed on the subject concerned using the mapping rule corresponding to the abbreviation rule base to determine the subject abbreviation corresponding to the subject concerned; If the subject involved does not satisfy the mapping rule corresponding to the abbreviation rule library, a pre-trained target abbreviation generation model is used to generate an abbreviation for the subject involved to determine the subject abbreviation corresponding to the subject involved.
[0009] Preferably, clustering all the text data to be identified based on the addresses involved corresponding to the multiple text data to be identified to determine at least one initial address event cluster includes: Determine the target distance between any two addresses corresponding to the text data to be identified according to a preset distance determination algorithm; The text data to be identified corresponding to the involved addresses whose target distances meet the preset distance requirements are clustered into the same event cluster to obtain at least one initial address event cluster.
[0010] Preferably, the performing similarity clustering on a plurality of to-be-recognized text data corresponding to each initial object event cluster to determine a target object event cluster corresponding to each initial object event cluster comprises: Based on the to-be-recognized text data corresponding to the initial object event cluster, determining a first text data and a plurality of second text data; Based on the pre-trained target text vector representation model, performing similarity analysis on each of the second text data and the first text data to obtain target text similarities corresponding to the plurality of second text data; If the target text similarities corresponding to all the second text data are less than the first similarity threshold, the first text data is deleted, and the text data to be identified corresponding to the initial object event cluster is repeatedly executed to determine one first text data and multiple second text data; If there is at least one target text similarity corresponding to the second text data that is not less than the first similarity threshold, then based on the second text data whose target text similarity is greater than the second similarity threshold and the first text data, determining a target object event cluster including the first text data; Based on the initial object event cluster and the target object event cluster, determining the remaining object event clusters and the amount of text data corresponding to the remaining object event clusters; If the amount of the text data is greater than a preset threshold, the remaining object event cluster is updated to the initial object event cluster, and the process of repeatedly performing the process based on the text data to be identified corresponding to the initial object event cluster to determine a first text data and a plurality of second text data; If the amount of text data is not greater than a preset threshold, the execution of the text data to be identified corresponding to the initial object event cluster is stopped, a first text data and a plurality of second text data are determined, and a target object event cluster corresponding to each of the initial object event clusters is obtained.
[0011] Preferably, before acquiring a plurality of text data to be recognized, the event recognition method further comprises: Obtain multiple training text data; Using a preset first vector representation model, a second vector representation model, and a third vector representation model respectively, the plurality of training text data are subjected to vector recall processing to obtain N pieces of recall data corresponding to each of the training text data, the N pieces of recall data including M text sample data, wherein N≥M≥3; Performing statistical analysis on the N pieces of recalled data corresponding to the training text data, sorting the M pieces of text sample data in descending order of the number of occurrences, determining the first L pieces of text sample data as positive samples corresponding to the training text data, and determining the remaining (ML) pieces of text sample data as negative samples corresponding to the training text data, wherein 1<L≤M; Based on the multiple training text data, the positive samples corresponding to each training text data and the negative samples corresponding to each training text data, multiple text triplets are constructed, and the original text vector representation model is trained based on the multiple text triplets to obtain a trained target text vector representation model.
[0012] An event recognition device, comprising: A module for acquiring text data to be recognized, used for acquiring a plurality of text data to be recognized; An identification module, used to identify a plurality of text data to be identified, and determine the subject and address involved corresponding to each of the text data to be identified; An initial subject event cluster determination module, based on the subjects involved corresponding to the multiple text data to be identified, clusters all the text data to be identified, and determines at least one initial subject event cluster; An initial address event cluster determination module, based on the addresses involved corresponding to the multiple text data to be identified, clusters all the text data to be identified, and determines at least one initial address event cluster; The similarity clustering module is used to perform similarity clustering on a plurality of text data to be identified corresponding to each initial object event cluster, and determine a target object event cluster corresponding to each initial object event cluster, wherein the initial object event cluster includes the initial subject event cluster and the initial address event cluster.
[0013] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned event recognition method when executing the computer program.
[0014] A computer-readable storage medium stores a computer program, and the computer program implements the above-mentioned event recognition method when executed by a processor.
[0015] The above-mentioned event identification method, device, computer equipment and storage medium, according to the subject involved, preliminarily cluster the text data to be identified, determine at least one initial subject event cluster corresponding to the subject involved, further cluster the similarity of multiple text data to be identified corresponding to each initial subject event cluster, and determine at least one target subject event cluster corresponding to each initial subject event cluster; according to the address involved, preliminarily cluster the text data to be identified, determine at least one initial address event cluster corresponding to the address involved, further cluster the similarity of multiple text data to be identified corresponding to each initial address event cluster, and determine at least one target address event cluster corresponding to each initial address event cluster. The method clusters the text data to be identified twice according to the address involved and the subject involved, clusters multiple text data to be identified into target subject event clusters and target address event clusters according to different clustering standards, achieves the purpose of accurately identifying the text data to be identified, improves the recognition accuracy of similar events corresponding to the text data to be identified, and the method can identify and cluster the text data to be identified in the user service scenario, and achieves accurate recognition of at least one similar event corresponding to the text data to be identified, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0017] Figure 1 is a flow chart of an event identification method in one embodiment of the present invention; Figure 2 is another flow chart of an event identification method according to an embodiment of the present invention; Figure 3 is another flow chart of an event identification method according to an embodiment of the present invention; Figure 4 is another flow chart of an event identification method according to an embodiment of the present invention; Figure 5 is another flow chart of an event identification method according to an embodiment of the present invention; Figure 6 is another flow chart of an event identification method according to an embodiment of the present invention; Figure 7 is another flow chart of an event identification method according to an embodiment of the present invention; Figure 8 is a schematic diagram of an event recognition device in one embodiment of the present invention; Fig. 9is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments 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 creative work are within the scope of protection of the present invention.
[0019] The event recognition method provided by the embodiment of the present invention is used to achieve the purpose of accurately identifying text data and obtain at least one target object event cluster corresponding to the same type of event. Among them, the target object event cluster includes a target subject event cluster and a target address event cluster. The target object event cluster refers to an event cluster corresponding to the same type of event obtained by identifying and clustering the text data to be identified, and each event cluster includes at least one text data of the same category. The target subject event cluster refers to a target object event cluster obtained after identifying and clustering the text data according to the subject involved in the text data. The target address event cluster refers to a target object event cluster obtained after identifying and clustering the text data according to the address involved in the text data. The subject involved refers to the subject object related to the event subject corresponding to the text data, and the subject object includes but is not limited to the name of a person, a company name, and an institution name. The address involved refers to an address related to the event subject corresponding to the text data, including but not limited to the address where the event subject corresponding to the text data occurs and the address related to the subject involved.
[0020] In one embodiment, if Figure 1 As shown, an event recognition method is provided, which is applied in Fig. 9 The computer device in the example is used as an example to illustrate, including the following steps: S101: Acquire a plurality of text data to be recognized; S102: Identify multiple text data to be identified, and determine the subject and address involved corresponding to each text data to be identified; S103: clustering all the text data to be identified based on the involved subjects corresponding to the multiple text data to be identified, and determining at least one initial subject event cluster; S104: clustering all the text data to be identified based on the addresses involved corresponding to the multiple text data to be identified, and determining at least one initial address event cluster; S105: performing similarity clustering on a plurality of to-be-recognized text data corresponding to each initial object event cluster, and determining a target object event cluster corresponding to each initial object event cluster, wherein the initial object event cluster includes an initial subject event cluster and an initial address event cluster.
[0021] The text data to be identified refers to the text data that needs to be identified.
[0022] As an example, in step S101, the computer device obtains multiple text data to be identified from multiple platforms in a legal and compliant manner. In this example, the computer device can collect data from web pages and / or applets corresponding to different platforms in the application scenario in a legal and compliant manner, and collect voice data in a legal and compliant manner, and collect data by transcribing the voice data to obtain multiple text data to be identified. For example, in a user service scenario, the computer device obtains the text data and voice data of user feedback received within a period of time in the user work order management system, transcribes the voice data, and determines the transcribed text data and user feedback text data as the text data to be identified. It can be understood that different text data contain different event themes, and there may be a situation in which multiple text data contain the same event theme in a large amount of text data. Then, the multiple text data containing the same event theme correspond to a similar event. Clustering a large amount of text data can identify different similar events, so as to improve the data analysis and processing efficiency in the application scenario.
[0023] As an example, in step S102, the computer device uses a preset text data recognition method to recognize the multiple text data to be recognized, and determines the subject and address involved corresponding to each text data to be recognized. For example, for a text data to be recognized "complaint that the product quality of ×× company is poor, ×× company is located on ××× street", the computer device uses a preset text data recognition method to recognize the subject and address involved in the text data to be recognized, and obtains that the subject involved is ×× company, and the address involved is ××× street. Among them, the preset text data recognition method includes using a preset large language model to recognize the text data to be recognized, and the large language model includes but is not limited to qwen2-72B-Instruct. In this example, the subject and address involved corresponding to the text data to be recognized are determined, so that the text data to be recognized can be identified and clustered according to the subject or address involved, and the initial subject event clusters corresponding to different subjects involved, or the initial address event clusters corresponding to different addresses involved can be accurately determined.
[0024] The initial subject event cluster refers to an event cluster consisting of text data to be identified corresponding to the same subject involved. The event cluster consists of at least one text data to be identified.
[0025] As an example, in step S103, the computer device clusters multiple text data to be identified according to the clustering method that the text data to be identified corresponding to the same subject involved form an initial subject event cluster, and obtains at least one initial subject event cluster. It can be understood that the possibility that the text data to be identified corresponding to the same subject involved corresponds to the same type of event is high, and the text data to be identified corresponding to the same subject involved is formed into the same initial subject event cluster, so as to facilitate the subsequent further clustering of the text data to be identified in the same initial subject event cluster, thereby improving the accuracy of the recognition of the text data to be identified.
[0026] The initial address event cluster refers to an event cluster consisting of text data to be identified corresponding to the same address involved.
[0027] As an example, in step S104, the computer device clusters the text data to be identified corresponding to the addresses involved according to the address distance relationship between the addresses involved, and obtains at least one initial address event cluster. For example, the computer device clusters the multiple text data to be identified in a manner that the text data to be identified corresponding to the same address involved form an initial address event cluster, and obtains at least one initial address event cluster. For another example, the computer device clusters the text data to be identified corresponding to the addresses involved in the same municipal area into an initial address event cluster, and obtains at least one initial address event cluster. It can be understood that the text data to be identified corresponding to the addresses involved in close areas have a higher probability of corresponding to the same type of event, and the text data to be identified corresponding to the addresses involved in close areas are formed into the same initial address event cluster, so as to facilitate the subsequent further clustering of the initial address event clusters and improve the accuracy of the recognition of the text data to be identified.
[0028] Among them, similarity clustering refers to clustering multiple text data to be identified corresponding to the same initial subject event cluster or the same initial address event cluster according to the similarity between the text data to be identified. The initial object event cluster includes the initial subject event cluster and the initial address event cluster. For the convenience of description, the initial subject event cluster and the initial address event cluster are collectively referred to as the initial object event cluster.
[0029] As an example, in step S105, the computer device uses a preset similarity algorithm to perform similarity analysis on multiple text data to be identified corresponding to each initial object event cluster, determine the similarity between any two text data to be identified in the same initial object event cluster, cluster the text data to be identified with higher similarity into the same target object event cluster, and obtain the target object event cluster corresponding to each initial object event cluster. Wherein, the preset similarity algorithm includes but is not limited to the cosine similarity algorithm and the Euclidean distance algorithm. For example, the initial object event cluster includes text data i to be identified, text data j to be identified, text data k to be identified, and text data p to be identified. If only the similarity between text data i to be identified and text data j to be identified is greater than the preset threshold, and the similarity between text data k to be identified and text data p to be identified is greater than the preset threshold, then the text data i to be identified and the text data j to be identified are clustered into the same target object event cluster, and the text data k to be identified and the text data p to be identified are clustered into another target object event cluster. Wherein, the initial object event cluster can be an initial subject event cluster or an initial address event cluster. In this example, the computer device uses the above method to perform similarity clustering on multiple text data to be identified in each initial subject event cluster, and obtains at least one target subject event cluster corresponding to each initial subject event cluster. The above method is used to perform similarity clustering on multiple text data to be identified in each initial address event cluster, and obtains at least one target address event cluster corresponding to each initial address event cluster. In this example, different text data to be identified in the same initial object event cluster are clustered into different event clusters to achieve the identification of at least one similar event corresponding to the text data to be identified. The initial subject event clusters clustered according to the subject involved are further clustered to obtain the target subject event cluster corresponding to each initial subject event cluster, so as to achieve the accurate classification of the text data to be identified, and then achieve the accurate identification of at least one similar event corresponding to the text data to be identified; the initial address event clusters clustered according to the address involved are further clustered to obtain the target address event cluster corresponding to each initial address event cluster, so as to achieve the accurate classification of the text data to be identified, and then achieve the accurate identification of at least one similar event corresponding to the text data to be identified.
[0030] In this embodiment, according to the subject involved, the text data to be identified is preliminarily clustered to determine at least one initial subject event cluster corresponding to the subject involved, and the similarity of multiple text data to be identified corresponding to each initial subject event cluster is further clustered to determine at least one target subject event cluster corresponding to each initial subject event cluster; according to the address involved, the text data to be identified is preliminarily clustered to determine at least one initial address event cluster corresponding to the address involved, and the similarity of multiple text data to be identified corresponding to each initial address event cluster is further clustered to determine at least one target address event cluster corresponding to each initial address event cluster. This method clusters the text data to be identified twice according to the address involved and the subject involved, clusters multiple text data to be identified into target subject event clusters and target address event clusters according to different clustering standards, achieves the purpose of accurately identifying the text data to be identified, improves the recognition accuracy of similar events corresponding to the text data to be identified, and this method can identify and cluster the text data to be identified in, including but not limited to, user service scenarios, and achieves accurate recognition of at least one similar event corresponding to the text data to be identified, and has broad application prospects.
[0031] In one embodiment, if Figure 2 As shown, step S102, i.e., identifying a plurality of text data to be identified, and determining the subject and address involved corresponding to each text data to be identified, includes: S201: using a pre-trained target recognition model to recognize a plurality of text data to be recognized, and obtaining a recognition result corresponding to a target format; S202: Using a preset extraction algorithm, extract the recognition results corresponding to each target format, and determine the subject and address involved corresponding to each text data to be identified.
[0032] The target recognition model refers to a model for recognizing the subject and address of the text data to be recognized. The target format refers to the format of the subject and address of the target recognition model output, for example, a string format. The recognition result refers to the output of the target recognition model.
[0033] As an example, in step S201, the computer device uses a pre-trained target recognition model to recognize multiple text data to be recognized, and obtains a recognition result in a target format. The target recognition model includes but is not limited to a large language model. For example, the qwen2-7B-Instruct model. In this example, the computer device inputs each text data to be recognized into the qwen2-7B-Instruct model obtained by pre-fine-tuning training in turn, and outputs the subject and address involved in a string format corresponding to each text data to be recognized.
[0034] In this example, the steps of pre-training the target recognition model by the computer device include: (1) Obtain multiple training samples with the addresses and addresses involved marked. In this example, the computer device uses a large language model (e.g., the qwen2-7B-Instruct model) to mark the subjects and addresses involved in the training samples, obtain the marking results, and manually review the marking results to obtain the marked training samples. For example, for a training sample "The quality of the ×× goods generated by ×× Company on ×× Street is very good", the qwen2-7B-Instruct model is used to mark the subjects and addresses involved in "The quality of the ×× goods generated by ×× Company on ×× Street is very good". If the marking result is: "Subject involved: ×× Company, address involved: ×× Street", after manual review, the marking result of "Subject involved: ×× Company, address involved: ×× Street" is kept unchanged, and the string format corresponding to the marking result is determined to correspond to the training sample as the marked training sample. If the labeling result is: "Subject involved: ×× commodity, address involved: ×× street", after manual review, the labeling result is changed to "Subject involved: ×× company, address involved: ×× street", and the changed labeling result is matched with the training sample to determine it as the labeled training sample. In this way, multiple training samples with the address involved and subject involved are obtained.
[0035] (2) The computer device uses multiple training samples of annotated addresses and entities to train the original recognition model to obtain a target recognition model. In this example, the original recognition model is the qwen2-7B-Instruct model. The computer device inputs each training sample into the qwen2-7B-Instruct model, outputs the annotated addresses and entities in the string format corresponding to the training sample, uses the string format corresponding to the annotation result corresponding to the training sample as the training label, and performs loss calculation on the addresses and entities in the string format output by the model. The qwen2-7B-Instruct model is fine-tuned based on the loss calculation result until the qwen2-7B-Instruct model converges, thereby obtaining a target recognition model for identifying addresses and entities in the text data to be recognized.
[0036] Among them, the preset extraction algorithm refers to an algorithm for extracting the subject and address involved in the recognition result with the target format.
[0037] As an example, in step S202, the computer device uses a preset extraction algorithm to extract the recognition results with the target format corresponding to each text data to be recognized, and determines the subject and address involved corresponding to each text data to be recognized. In this example, the preset extraction algorithm corresponds to the target format. For example, if the target format is a string format, the computer device uses a regular expression to extract the recognition results in the string format to obtain the subject and address involved corresponding to the text data to be recognized.
[0038] In this embodiment, the subject and address involved corresponding to the text data to be identified are accurately determined through a pre-trained target recognition model, so that the text data to be identified can be accurately clustered according to the subject and address involved.
[0039] In one embodiment, if Figure 3 As shown, step S103, that is, clustering all the text data to be identified based on the involved subjects corresponding to the multiple text data to be identified, and determining at least one initial subject event cluster, includes: S301: Analyze and process the involved parties corresponding to the plurality of text data to be identified respectively, and determine the abbreviation of the party corresponding to each text data to be identified; S302: Clustering the text data to be recognized based on the subject abbreviation corresponding to each text data to be recognized, and determining at least one initial subject event cluster.
[0040] The abbreviation of the subject refers to the abbreviation of the subject involved.
[0041] As an example, in step S301, the computer device analyzes and processes the involved subject corresponding to the text data to be identified in turn, and determines the subject abbreviation corresponding to the involved subject. For example, if the involved subject is "Yuntian Lifei Co., Ltd.", the computer device analyzes and processes "Yuntian Lifei Co., Ltd." and determines that the subject abbreviation corresponding to "Yuntian Lifei Co., Ltd." is "Yuntian Lifei". Understandably, in different text data to be identified, the name of the same involved subject may be different, that is, different titles refer to the same subject. The subject abbreviation of the involved subject is determined, and the involved subjects with different titles are unified to avoid the problems of inconsistent involved subjects, low clustering efficiency, and low accuracy, so as to improve the accuracy and efficiency of clustering.
[0042] As an example, in step S302, the computer device clusters the text data to be identified corresponding to the same subject abbreviation into an initial subject event cluster. Repeat the above steps to cluster all the text data to be identified, obtain at least one initial subject event cluster, and achieve preliminary clustering of all the text data to be identified. For example, if multiple text data to be identified correspond to a subject abbreviations, the computer device clusters the text data to be identified corresponding to the same subject abbreviation into an initial subject event cluster, and obtains a initial subject event clusters.
[0043] In this embodiment, the text data to be identified with the same subject abbreviation is more likely to be the same type of events. Based on the subject abbreviation, the text data to be identified is preliminarily clustered, and the initial subject event clusters corresponding to the same type of events can be identified more accurately.
[0044] In one embodiment, if Figure 4 As shown, step S301, that is, analyzing and processing the involved entities corresponding to the multiple text data to be identified respectively, and determining the abbreviation of the entity corresponding to each text data to be identified, includes: S401: If the subject involved meets the mapping rule corresponding to the abbreviation rule base, the mapping rule corresponding to the abbreviation rule base is used to generate an abbreviation for the subject involved, and the subject abbreviation corresponding to the subject involved is determined; S402: If the subject involved does not satisfy the mapping rule corresponding to the abbreviation rule library, a pre-trained target abbreviation generation model is used to generate an abbreviation for the subject involved to determine the subject abbreviation corresponding to the subject involved.
[0045] The abbreviation rule base refers to a database storing the subject involved and its corresponding subject abbreviation. The mapping rule refers to the rule for mapping the subject involved to the subject abbreviation.
[0046] As an example, in step S401, the computer device determines whether the subject involved meets the mapping rules in the preset abbreviation rule library. When it is determined that the subject involved meets the mapping rules in the preset abbreviation rule library, the mapping rules corresponding to the abbreviation rule library are used to generate the abbreviation of the subject involved, and the subject abbreviation corresponding to the subject involved is determined. For example, the abbreviation rule library maps and stores specific subjects involved and subjects involved. For example, for subjects involved that are composed of sensitive words that cannot be recognized by the model, an abbreviation rule library is constructed, and the computer device determines whether the subject involved has sensitive words that cannot be recognized by the model. If there are sensitive words, it is determined that the subject involved meets the mapping rules corresponding to the abbreviation rule library. Based on the sensitive words of the subject involved, the abbreviation rule library is queried to determine the subject abbreviation corresponding to the subject involved in the abbreviation rule library. In this example, when the subject involved meets the mapping rules corresponding to the abbreviation rule library, the mapping rules corresponding to the abbreviation rule library are used to determine the subject abbreviation corresponding to the subject involved. The subject abbreviation can be generated without complex processing of the subject involved, which is relatively convenient and quick.
[0047] Among them, the target abbreviation generation model refers to a model for generating abbreviations for the subject involved. In this embodiment, the target abbreviation generation model is obtained by training the base model. Among them, the base model is a large language model, including but not limited to the qwen2-7B-Instruct model. Specifically, by obtaining the subject involved and the address involved for model training, as well as the subject abbreviation, the large language model is trained and adjusted for the subject abbreviation generation task, and when the large language model converges, the target abbreviation generation model is obtained.
[0048] As an example, in step S402, when the computer device determines that the subject involved does not satisfy the mapping rule corresponding to the abbreviation rule library, the computer device inputs the subject involved into the pre-trained target abbreviation generation model, outputs the subject abbreviation corresponding to the subject involved, and the computer device sequentially inputs all the subjects involved that do not satisfy the mapping rule into the target abbreviation generation model, and outputs the subject abbreviations corresponding to all the subjects involved that do not satisfy the mapping rule. In this example, the pre-trained target abbreviation generation model is used to process the subjects involved that do not satisfy the mapping rule corresponding to the abbreviation rule library, generate subject abbreviations, and complete the generation of abbreviations for the subjects involved corresponding to all text data to be identified, making it feasible to cluster the text data to be identified according to the subject abbreviations.
[0049] In this embodiment, different methods are used to generate the subject abbreviation corresponding to the subject involved according to whether the subject involved meets the mapping rules corresponding to the abbreviation rule library, without the need for complex processing of the subject involved, which is relatively convenient and quick.
[0050] In one embodiment, if Figure 5As shown, step S104, i.e. clustering all the text data to be identified based on the involved addresses corresponding to the multiple text data to be identified, and determining at least one initial address event cluster, includes: S501: Determine the target distance between any two addresses corresponding to the text data to be identified according to a preset distance determination algorithm; S502: Cluster the text data to be identified corresponding to the involved addresses whose target distances meet the preset distance requirements into the same event cluster to obtain at least one initial address event cluster.
[0051] The distance determination algorithm refers to a method for determining the distance between the addresses corresponding to the two text data to be identified. The target distance refers to the distance between the addresses corresponding to the two text data to be identified.
[0052] As an example, in step S501, the computer device calculates the distance between any two addresses corresponding to the text data to be identified according to the preset distance determination algorithm, and determines the target distance between any two addresses corresponding to the text data to be identified. In this example, the computer device determines the target distance between any two texts to be identified according to the regional level division method. For example, the addresses involved are divided into regional levels according to the country, province, city, district (county) and street (township), that is, the country is a five-level region, the province is a four-level region, the city is a three-level region, the district (county) is a second-level region, and the street (township) is a first-level region, wherein the regional level of the second-level region is higher than the regional level of the first-level region, the regional level of the third-level region is higher than the second-level regional level of the first-level region, the regional level of the fourth-level region is higher than the regional level of the third-level region, and the regional level of the fifth-level region is higher than the regional level of the fourth-level region. The computer device determines the highest difference level between the two addresses involved, and determines the highest difference level as the target distance between any two text data to be identified. Among them, the highest difference level refers to the value corresponding to the highest regional level where there is a difference between the two addresses involved. For example, the address involved in one text data to be identified is C Street, B District, Shenzhen City, Guangdong Province, China, and the address involved in another text data to be identified is E Street, D District, Guangzhou City, Guangdong Province, China. The highest level of difference between the two addresses involved is the third-level region (city), then the target distance corresponding to the two addresses involved is 3.
[0053] The preset distance requirement refers to the distance requirement for determining whether the to-be-identified text data corresponding to the two involved addresses can be clustered into the same event cluster. In this example, the preset distance requirement can be a distance threshold or a range corresponding to the distance.
[0054] As an example, in step S502, the computer device judges the target distance corresponding to any two text data to be identified, clusters any two text data to be identified corresponding to the address involved whose target distance meets the preset distance requirement into the same event cluster, repeats the above judgment process, clusters all text data to be identified corresponding to all the addresses involved, and obtains at least one initial address event cluster. For example, the text data to be identified includes text data to be identified i, text data to be identified j, and text data to be identified p. If the target distance between the address involved corresponding to the text data to be identified i and the address involved corresponding to the text data to be identified j meets the preset distance requirement, the text data to be identified i and the text data to be identified j are clustered into the same event cluster. Further, if the distance involved corresponding to the text data to be identified p and the address involved corresponding to any one of the text data to be identified i and the text data to be identified j meet the preset distance requirement, the text data to be identified p and the text data to be identified i and the text data to be identified j are clustered into the same event cluster, and an initial address event cluster is obtained. If the involved distance corresponding to the text data p to be identified and the involved address corresponding to each of the text data i to be identified and the text data j to be identified do not meet the preset distance requirement, the text data p to be identified is treated as an event cluster alone, that is, the text data i to be identified and the text data j to be identified form an initial address event cluster, and the text data p to be identified forms another initial address event cluster. In this example, the preset distance requirement includes that the target distance is less than the distance threshold, wherein the distance threshold may be 3. The preset distance requirement includes that the target distance is within a preset distance range, wherein the preset distance range is [0, 3]. It can be understood that the smaller the target distance between the involved addresses corresponding to the two text data to be identified, the greater the probability that the two text data to be identified are the same type of event. Therefore, any two text data to be identified corresponding to the involved addresses whose target distance meets the preset distance requirement are clustered into the same event cluster to obtain at least one initial address event cluster, so as to improve the accurate identification of the same type of events corresponding to the text data to be identified based on the initial address event cluster in the subsequent process.
[0055] In this embodiment, all the text data to be identified are preliminarily clustered according to whether the target distance between the addresses corresponding to any two of the text data to be identified meets the preset distance requirement, and at least one initial address event cluster is obtained, so that it is feasible to further cluster the text data to be identified based on the initial address event cluster.
[0056] In one embodiment, the initial object event cluster includes an initial subject event cluster and an initial address event cluster.
[0057] Understandably, in this embodiment, the text data to be identified is preliminarily clustered according to the subject involved and the address involved, and at least one initial subject event cluster and at least one initial address event cluster are obtained respectively. It is necessary to further identify the text data to be identified corresponding to the same initial subject event cluster, that is, further cluster the text data to be identified corresponding to the same initial subject event cluster, and identify different similar events. It is also necessary to further identify the text data to be identified corresponding to the same initial address event cluster, that is, further cluster the text data to be identified corresponding to the same initial address event cluster, and identify different similar events. Although the two text data to be identified in the same initial subject event cluster correspond to the same subject involved, they may correspond to different similar events. For example, the similar event corresponding to one text data to be identified is a complaint to the subject involved, and the similar event corresponding to the other text data to be identified is a business consultation to the subject involved. The same subject involved corresponds to different similar events. Therefore, it is necessary to further cluster the initial subject event cluster to improve the accuracy of the identification of the text data to be identified and accurately identify the similar events corresponding to different text data to be identified. For another example, for two text data to be identified in the same initial address event cluster, one of the text data to be identified is used to query the navigation route of the address in question, and the other text data to be identified is used to complain about the products of the company where the address in question is located. They belong to different similar events. Therefore, the initial address event cluster needs to be further clustered to improve the accuracy of identifying the text data to be identified and accurately identify similar events corresponding to different text data to be identified.
[0058] In one embodiment, if Figure 6 As shown, step S105, i.e., performing similarity clustering on a plurality of to-be-recognized text data corresponding to each initial object event cluster, and determining a target object event cluster corresponding to each initial object event cluster, comprises: S601: Determine a first text data and a plurality of second text data based on the text data to be recognized corresponding to the initial object event cluster; S602: Based on the pre-trained target text vector representation model, perform similarity analysis on each second text data and the first text data to obtain target text similarities corresponding to the plurality of second text data; S603: If the target text similarities corresponding to all the second text data are less than the first similarity threshold, the first text data is deleted, and the text data to be identified corresponding to the initial object event cluster is repeatedly executed to determine one first text data and multiple second text data; S604: If there is at least one second text data corresponding to a target text whose similarity is not less than the first similarity threshold, determine a target object event cluster including the first text data based on the second text data and the first text data whose target text similarity is greater than the second similarity threshold; S605: Determine the remaining object event clusters and the amount of text data corresponding to the remaining object event clusters based on the initial object event cluster and the target object event cluster; S606: if the amount of text data is greater than a preset amount threshold, the remaining object event clusters are updated to the initial object event clusters, and the process of repeatedly performing the process based on the text data to be recognized corresponding to the initial object event clusters to determine a first text data and a plurality of second text data; S607: If the amount of text data is not greater than the preset threshold, stop executing the text data to be identified corresponding to the initial object event cluster, determine a first text data and a plurality of second text data, and obtain a target object event cluster corresponding to each initial object event cluster.
[0059] In this embodiment, when the initial object event cluster is the initial subject event cluster, the target object event cluster is the target subject event cluster; when the initial object event cluster is the initial address event cluster, the target object event cluster is the target subject event cluster.
[0060] The first text data refers to any text data to be recognized in the initial object event cluster, and the second text data refers to the remaining text data to be recognized in the initial object event cluster to which the first text data belongs, except the first text data.
[0061] As an example, in step S601, the computer device identifies the text data to be identified corresponding to the initial object event cluster, and determines any one of the text data to be identified in the same initial object event cluster as the first text data, and determines the remaining text data to be identified in the same initial object event cluster as the second text data. For example, if the same initial object event cluster includes G (where G≥2) text data to be identified, any one of the text data to be identified is determined as the first text data, and the remaining (G-1) text data to be identified is determined as the second text data. In this example, the initial object event cluster includes an initial subject event cluster and an initial address event cluster, and the computer device obtains one first text data and multiple second text data in the initial subject event cluster, and one first text data and multiple second text data in the initial address event cluster.
[0062] Among them, the target text vector representation model is used to perform vector representation on the first text data and the second text data. Understandably, in order to perform similarity analysis on the first text data and the second text data, it is necessary to perform vector representation on the first text data and the second text data, obtain the feature vector corresponding to the first text data and the feature vector corresponding to the second text data, so as to determine the similarity between the first text data and the second text data based on the feature vector corresponding to the first text data and the feature vector corresponding to the second text data. In this example, the similarity includes but is not limited to cosine similarity and Euclidean distance.
[0063] As an example, in step S602, the computer device uses a pre-trained target text vector representation model to sequentially perform vector representation on the first text data and each second text data corresponding to the first text data, obtain a feature vector of the first text data, and feature vectors of multiple second text data corresponding to the first text data, and the computer device performs similarity calculation based on the feature vector corresponding to each second text data and the feature vector corresponding to the first text data, and determines the target text similarity between each second text data and the first text data. For example, the computer device can calculate the cosine similarity between each second text data and the first text data through the feature vector corresponding to each second text data and the feature vector corresponding to the first text data, and determine the cosine similarity as the target text similarity between the second text data and the first text data.
[0064] The first similarity threshold refers to a preset threshold for determining the similarity of target texts.
[0065] As an example, in step S603, the computer device determines the relationship between the target text similarity between all the second text data and the first text data and the first similarity threshold. If all the target text similarities are less than the first similarity threshold, the first text data in the initial object event cluster is deleted, and the computer device repeats steps S601 to S603, that is, the computer device obtains all the first text data in each initial object event cluster and multiple second text data corresponding to each first text data, and obtains the target text similarity between all the second text data corresponding to each first text data and the first text data in each initial object event cluster, and deletes the first text data in each initial object event cluster whose target text similarity with all the second text data is less than the first similarity threshold.
[0066] For example, if an initial object event cluster includes text data i to be identified, text data j to be identified, text data k to be identified, and text data p to be identified, the computer device determines the text data i to be identified as the first text data, and determines the text data j to be identified, the text data k to be identified, and the text data p to be identified as the second text data, and respectively determines the target text similarity between each second text data and the first text data. If all target text similarities are less than the first similarity threshold, it indicates that the text data i to be identified does not correspond to the same type of event, and the text data i to be identified in the initial object event cluster is deleted. The computer device determines the text data j to be identified as the first text data, and determines the text data k to be identified and the text data p to be identified as the second text data, and repeatedly performs the above steps of obtaining the target text similarity between each second text data and the first text data, and deletes the first text data less than the first similarity threshold, and obtains the initial object event cluster after deleting the first text data less than the first similarity threshold. Among them, the initial object event cluster can be an initial subject event cluster or an initial address event cluster.
[0067] In this example, the initial object event cluster includes an initial subject event cluster and an initial address event cluster. The computer device deletes the first text data in each initial subject event cluster whose target text similarity with all second text data is less than the first similarity threshold, and the first text data in the initial address event cluster whose target text similarity with all second text data is less than the first similarity threshold. The first similarity threshold is 0.5. It is understandable that since there are more than one text data to be identified corresponding to the same type of events, if the target text similarity of all second text data with the first text data is lower than the first similarity threshold, it indicates that the first text data does not correspond to the same type of events, and there is no need to cluster. The text data to be identified in each initial object event cluster that has a low similarity with other text data to be identified is eliminated, so as to accurately identify the text data to be identified and identify different events of the same type.
[0068] The target object event cluster refers to an event cluster obtained by identifying and clustering the text data to be identified, and each target object event cluster corresponds to an event of the same type. The second similarity threshold refers to a similarity threshold used to cluster the first text data and the second text data.
[0069] As an example, in step S604, for the first text data, when the computer device determines that there is at least one second text data corresponding to the target text similarity not less than the first similarity threshold, the first text data is retained, and the second text data whose target text similarity is greater than the second similarity threshold and the first text data are clustered into a target object event cluster containing the first text data. In this example, the first similarity threshold is not greater than the second similarity threshold. For example, the first similarity threshold is 0.5, and the second similarity threshold is 0.9.
[0070] For example, when the initial object event cluster is the initial subject event cluster, the computer device determines the relationship between the target text similarity between the first text data and all the second text data corresponding to the first text data in the initial subject event cluster and the first similarity threshold. If the target text similarity between the first text data and at least one second text data is not less than the first similarity threshold, the first text data is retained, and the second text data whose similarity with the first text data is greater than the second similarity threshold is clustered with the first text data into the same target subject event cluster.
[0071] For example, when the initial object event cluster is the initial address event cluster, the computer device determines the relationship between the target text similarity between the first text data and all the second text data corresponding to the first text data in the initial address event cluster and the first similarity threshold. If the target text similarity between the first text data and at least one second text data is not less than the first similarity threshold, the first text data is retained, and the second text data whose similarity with the first text data is greater than the second similarity threshold is clustered with the first text data into the same target address event cluster.
[0072] The remaining object event cluster refers to an event cluster composed of text data to be identified for similarity clustering. The amount of text data refers to the amount of text data to be identified in the remaining object event cluster.
[0073] As an example, in step S605, after the computer device performs similarity clustering on the data to be identified in the initial object event cluster to obtain the target object event cluster, the computer device determines the text data to be identified in the initial object event cluster that is not clustered into the target object event cluster as the remaining object event cluster, and determines the number of text data to be identified in the remaining object event cluster, and uses the number as the amount of text data corresponding to the remaining object event cluster. For example, the computer device determines that the number of text data to be identified that is not clustered into the target object event cluster in the remaining object event cluster is S, and then determines that the amount of text data corresponding to the remaining object event cluster is S. For example, if there are G text data to be identified in the initial object event cluster, of which F form the target object event cluster, and there are (GF) text data to be identified, the (GF) text data to be identified are determined as the remaining object event cluster, and the amount of text data corresponding to the remaining object event cluster is S, where S=(GF), G≥F, S≥0.
[0074] The preset quantity threshold refers to the preset quantity threshold for judging the amount of text data corresponding to the remaining object event clusters. It can be understood that the amount of text data to be identified corresponding to the same type of events needs to be greater than the preset quantity threshold. If the amount of text data is not greater than the preset quantity threshold, it indicates that the text data to be identified does not correspond to the same type of events, and the similarity clustering of the text data to be identified can be stopped, that is, the event corresponding to the text data to be identified can be stopped.
[0075] As an example, in step S606, when the computer device determines that the amount of text data corresponding to the remaining object event clusters is greater than a preset quantity threshold, the computer device updates the remaining object event clusters to the initial object event clusters, and repeats steps S601 to S605, that is, continues to divide the updated initial object event cluster into the first text data and the second text data, and continues to perform similarity clustering on the first text data and the second text data. For example, if the amount of text data in the remaining object event cluster is S, and S is greater than a preset quantity threshold, the remaining object event cluster is updated to the initial object event cluster, and based on the S data to be identified, a first text data and (S-1) second text data are determined, and steps S602 to S605 are repeated to perform similarity clustering on the S text data to be identified to obtain a target object event cluster, and the text data to be identified that have not been successfully clustered are determined, and the text data to be identified that have not been successfully clustered are used as the remaining object event cluster, and the text quantity of the text data to be identified that have not been successfully clustered is determined as the text data quantity corresponding to the remaining object event cluster, and step S606 is continued until the amount of text data is no greater than the preset quantity threshold.
[0076] As an example, in step S607, when the computer device determines that the amount of text data corresponding to the remaining object event clusters is not greater than the preset quantity threshold, it stops executing steps S601 to S605, determines that the similarity clustering of the multiple text data to be identified corresponding to the initial object event cluster is completed, and obtains at least one target object event cluster corresponding to the initial object event cluster. The computer device executes steps S601 to S607 for all initial object event clusters to obtain at least one target object event cluster corresponding to each initial object event cluster. In this example, if the initial object event cluster is an initial subject event cluster, the target object event cluster is a target subject event cluster. If the initial object event cluster is an initial address event cluster, the target object event cluster is a target address event cluster. According to the subject involved, the text data to be identified is clustered twice to achieve accurate identification of similar events corresponding to the text data to be identified corresponding to different subjects involved. According to the address involved, the text data to be identified is clustered twice to achieve accurate identification of similar events corresponding to the text data to be identified corresponding to different addresses involved.
[0077] In this embodiment, according to the first similarity threshold, the text data to be identified in each initial object event cluster whose target text similarity does not meet the first similarity threshold is eliminated, which can effectively exclude non-similar events in the text data to be identified, and the text data to be identified in each initial object event cluster is further clustered according to the second similarity threshold, so that the text data to be identified can be accurately classified, and the target object event clusters corresponding to different similar events are identified, and according to whether the amount of text data corresponding to the remaining object event clusters is greater than the preset quantity threshold, it is determined whether to update the remaining object event clusters to the initial object event clusters, and continue to perform similarity clustering on the text data to be identified in the initial object event clusters, which can effectively improve the clustering efficiency of the initial object event clusters, and then achieve efficient clustering of all initial object event clusters, and obtain the target object event clusters corresponding to all initial object event clusters.
[0078] In one embodiment, if Figure 7 As shown, before step S101, that is, before obtaining a plurality of text data to be recognized, the event recognition method further includes: S701: Acquire multiple training text data; S702: respectively using a preset first vector representation model, a second vector representation model, and a third vector representation model to perform vector recall processing on a plurality of training text data to obtain N pieces of recall data corresponding to each training text data, where the N pieces of recall data include M text sample data, where N≥M≥3; S703: Perform statistical analysis on the N recall data corresponding to the training text data, sort the M text sample data in descending order of the number of occurrences, determine the first L text sample data as positive samples corresponding to the training text data, and determine the remaining (ML) text sample data as negative samples corresponding to the training text data, where 1<L≤M; S704: Based on multiple training text data, positive samples corresponding to each training text data and negative samples corresponding to each training text data, multiple text triplets are constructed, and an original text vector representation model is trained based on the multiple text triplets to obtain a trained target text vector representation model.
[0079] The training text data refers to the text data used to train the target text vector representation model.
[0080] As an example, in step S701, the computer device obtains a plurality of text data for training the vector representation model as training text data. In this example, the training text data may come from a work order management platform in a user service scenario.
[0081] Among them, the first vector representation model, the second vector representation model and the third vector representation model are models for vector recall. Recall data refers to the number of recalled text sample data, and there may be duplicate text sample data. Text sample data refers to text data recalled based on training text data. For example, the recall data is 300, but due to the existence of duplicate text sample data, the text sample data is 200.
[0082] As an example, in step S702, the computer device uses a preset first vector representation model, a second vector representation model, and a third vector representation model to perform vector recall processing on each training text data, respectively. The first vector representation model recalls the vector corresponding to each training text data. The second vector represents the model recall of each training text data corresponding to The third vector represents the model recall of each training text data corresponding to recall data, and obtain N recall data corresponding to each training text data, where the N recall data include M text sample data. It is understandable that there are repeated text sample data in the recall data. For example, for the same training text data, the first vector representation model, the second vector representation model, and the third vector representation model may recall the same text sample data. In this example, the first vector representation model, the second vector representation model, and the third vector representation model include but are not limited to the bge-large-zh-v1.5 model, the gte-large-zh model, and the bce-embedding-base-v1 model. In this example, vector recall processing is performed on each training sample data to obtain recall data, so as to facilitate the subsequent construction of text triples and model training.
[0083] As an example, in step S703, the computer device performs statistical analysis on N pieces of recall data corresponding to a training text data, determines the number of occurrences of each text sample data in the N pieces of recall data, sorts the M text sample data in descending order of the number of occurrences, and obtains a sorting result. In the sorting result, the first L text sample data are determined as positive samples corresponding to the training text data, and the remaining (ML) text sample data are determined as negative samples corresponding to the training text data. The computer device repeatedly performs the above step S703 to determine the positive sample corresponding to each training sample data and the negative sample corresponding to each training sample data, so as to construct a text triple for model training.
[0084] Among them, a text triplet refers to a text data combination consisting of training text data, positive samples corresponding to the same training text data, and negative samples corresponding to the same training text data.
[0085] As an example, in step S704, the computer device forms a text triple with each training text data, the positive sample corresponding to each training text data and the negative sample corresponding to each training text data, obtains a plurality of text triples corresponding to the training text data, inputs the training text data in the text triples into the original text vector representation model, obtains the feature vector corresponding to the training text data, inputs the positive sample corresponding to the training text data into the original text vector representation model, obtains the feature vector corresponding to the positive sample, inputs the negative sample corresponding to the training text data into the original text vector representation model, obtains the feature vector corresponding to the negative sample, and determines the loss function value of the original text vector representation model in the training process according to the feature vector corresponding to the training text data, the feature vector corresponding to the positive sample and the feature vector corresponding to the negative sample, so as to minimize the distance between the feature vector corresponding to the training text data and the feature vector corresponding to the positive sample, and maximize the distance between the feature vector corresponding to the training text data and the feature vector corresponding to the negative sample. For example, the triple loss function value is calculated. When the loss function value does not converge, the original text vector representation model is updated, and when the loss function value converges, the updated original text vector representation model is determined as the target text vector representation model. Among them, the original text vector representation model can be an untrained minicpm-embedding model, and the target text vector representation model is a trained minicpm-embedding model.
[0086] In this embodiment, vector recall processing is performed on each text data to be trained to determine the positive and negative samples corresponding to each training text data. Based on each training text data and the positive and negative samples corresponding to each training text data, a text triple corresponding to each training text data is constructed. Based on the text triples, a target text vector representation model that can accurately extract feature vectors from text data is trained to facilitate the use of the target text vector representation model to accurately extract feature vectors from the text data to be recognized.
[0087] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0088] In one embodiment, an event recognition device is provided, which corresponds one-to-one to the event recognition method in the above embodiment. Figure 8 As shown, the event recognition device includes a to-be-recognized text data acquisition module 801, a recognition module 802, an initial subject event cluster determination module 803, an initial address event cluster determination module 804 and a similarity clustering module 805. The functional modules are described in detail as follows: The module 801 for acquiring text data to be recognized is used to acquire a plurality of text data to be recognized; An identification module 802 is used to identify a plurality of text data to be identified, and determine a subject involved and an address involved corresponding to each of the text data to be identified; The initial subject event cluster determination module 803 clusters all the text data to be identified based on the subjects involved corresponding to the multiple text data to be identified, and determines at least one initial subject event cluster; The initial address event cluster determination module 804 clusters all the text data to be identified based on the addresses involved corresponding to the multiple text data to be identified, and determines at least one initial address event cluster; The similarity clustering module 805 is used to perform similarity clustering on the multiple text data to be identified corresponding to each initial object event cluster, and determine the target object event cluster corresponding to each initial object event cluster, wherein the initial object event cluster includes the initial subject event cluster and the initial address event cluster.
[0089] In one embodiment, the identification module 802 includes: The recognition result acquisition submodule is used to recognize multiple text data to be recognized using a pre-trained target recognition model to obtain a recognition result corresponding to the target format; The extraction submodule is used to extract the recognition results corresponding to each target format using a preset extraction algorithm, and determine the subject and address involved corresponding to each text data to be identified.
[0090] In one embodiment, the initial subject event cluster determination module 803 includes: The subject abbreviation determination submodule is used to analyze and process the subjects involved corresponding to the multiple text data to be identified, and determine the subject abbreviation corresponding to each text data to be identified; The initial subject event cluster determination submodule clusters the text data to be identified based on the subject abbreviation corresponding to each text data to be identified, and determines at least one initial subject event cluster.
[0091] In one embodiment, the subject abbreviation determination submodule includes: A first subject abbreviation determination unit is used to generate an abbreviation for the subject involved by using the mapping rule corresponding to the abbreviation rule base, if the subject involved satisfies the mapping rule corresponding to the abbreviation rule base, to determine the subject abbreviation corresponding to the subject involved; The second subject abbreviation determination unit is used to generate abbreviations for the subject involved using a pre-trained target abbreviation generation model if the subject involved does not satisfy the mapping rules corresponding to the abbreviation rule library, so as to determine the subject abbreviation corresponding to the subject involved.
[0092] In one embodiment, the initial address event cluster determination module 804 includes: A target distance determination submodule is used to determine the target distance between any two addresses corresponding to the text data to be identified according to a preset distance determination algorithm; The initial address event cluster determination submodule is used to cluster the to-be-identified text data corresponding to the involved addresses whose target distances meet the preset distance requirements into the same event cluster to obtain at least one initial address event cluster.
[0093] In one embodiment, the similarity clustering module 805 includes: A text data classification submodule determines a first text data and a plurality of second text data based on the text data to be identified corresponding to the initial object event cluster; The target text similarity acquisition submodule performs similarity analysis on each second text data and the first text data based on the pre-trained target text vector representation model to obtain target text similarities corresponding to the plurality of second text data; A first judgment submodule is used for deleting the first text data if the target text similarities corresponding to all the second text data are less than a first similarity threshold, and repeatedly executing the text data to be identified corresponding to the initial object event cluster to determine one first text data and multiple second text data; A second judgment submodule is used to determine a target object event cluster including the first text data based on the second text data and the first text data whose target text similarity is greater than the second similarity threshold value if there is at least one second text data corresponding to the target text similarity is not less than the first similarity threshold value; The remaining object event cluster determination submodule determines the remaining object event clusters and the amount of text data corresponding to the remaining object event clusters based on the initial object event cluster and the target object event cluster; A third judgment submodule is used for updating the remaining object event clusters to the initial object event clusters if the amount of text data is greater than a preset amount threshold, and repeatedly executing the process of determining a first text data and a plurality of second text data based on the text data to be identified corresponding to the initial object event clusters; The fourth judgment submodule is used to stop executing the text data to be identified corresponding to the initial object event cluster if the amount of text data is not greater than a preset threshold, determine a first text data and multiple second text data, and obtain a target object event cluster corresponding to each initial object event cluster.
[0094] In another embodiment, the event recognition device further comprises: A training text data acquisition module, used to acquire multiple training text data; A vector recall processing module, used to respectively use a preset first vector representation model, a second vector representation model and a third vector representation model to perform vector recall processing on a plurality of training text data, to obtain N pieces of recall data corresponding to each training text data, wherein the N pieces of recall data include M text sample data, wherein N≥M≥3; The sample classification module is used to perform statistical analysis on the N recall data corresponding to the training text data, sort the M text sample data in descending order of the number of occurrences, determine the first L text sample data as positive samples corresponding to the training text data, and determine the remaining (ML) text sample data as negative samples corresponding to the training text data, where 1<L≤M; The model training module constructs multiple text triplets based on multiple training text data, positive samples corresponding to each training text data, and negative samples corresponding to each training text data, and trains the original text vector representation model based on the multiple text triplets to obtain a trained target text vector representation model.
[0095] For the specific definition of the event identification device, please refer to the definition of the event identification method above, which will not be repeated here. The various modules in the above-mentioned event identification device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0096] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data used or generated during the execution of the event identification method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an event identification method is implemented.
[0097] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the event recognition method in the above embodiment is implemented, for example Figure 1 S101-S105 as shown, or Figures 2 to 7Alternatively, when the processor executes the computer program, the functions of each module / unit in the event recognition device embodiment are realized, for example Figure 8 The functions of the to-be-recognized text data acquisition module 801, the recognition module 802, the initial subject event cluster determination module 803, the initial address event cluster determination module 804 and the similarity clustering module 805 are not described here in detail to avoid repetition.
[0098] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the event recognition method in the above embodiment is implemented, for example Figure 1 S101-S105 as shown, or Figures 2 to 7 Alternatively, when the computer program is executed by a processor, the functions of each module / unit in the above-mentioned event recognition device embodiment are realized, for example Figure 8 The functions of the to-be-recognized text data acquisition module 801, the recognition module 802, the initial subject event cluster determination module 803, the initial address event cluster determination module 804 and the similarity clustering module 805 are not described here in detail to avoid repetition.
[0099] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0100] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0101] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. An event recognition method, characterized in that: include: Obtain multiple text data to be recognized; Identify multiple text data to be identified, and determine the subject and address involved corresponding to each of the text data to be identified; Based on the involved subjects corresponding to the multiple text data to be identified, clustering all the text data to be identified to determine at least one initial subject event cluster; Based on the addresses involved corresponding to the multiple text data to be identified, clustering all the text data to be identified to determine at least one initial address event cluster; Similarity clustering is performed on a plurality of to-be-recognized text data corresponding to each initial object event cluster to determine a target object event cluster corresponding to each initial object event cluster, wherein the initial object event cluster includes the initial subject event cluster and the initial address event cluster.
2. The event recognition method according to claim 1, characterized in that: The step of identifying a plurality of text data to be identified and determining a subject involved and an address involved corresponding to each of the text data to be identified includes: Use the pre-trained target recognition model to recognize multiple text data to be recognized, and obtain the recognition results corresponding to the target format; A preset extraction algorithm is used to extract the recognition results corresponding to each of the target formats, and the subject involved and the address involved corresponding to each of the text data to be identified are determined.
3. The event recognition method according to claim 1, characterized in that: The method of clustering all the text data to be identified based on the involved subjects corresponding to the multiple text data to be identified to determine at least one initial subject event cluster includes: Analyze and process the involved entities corresponding to the plurality of text data to be identified respectively, and determine the abbreviation of the entity corresponding to each of the text data to be identified; Based on the subject abbreviation corresponding to each piece of text data to be recognized, the text data to be recognized are clustered to determine at least one initial subject event cluster.
4. The event recognition method according to claim 3, characterized in that: The analyzing and processing the involved entities corresponding to the plurality of text data to be identified respectively to determine the entity abbreviation corresponding to each text data to be identified includes: If the subject concerned satisfies the mapping rule corresponding to the abbreviation rule base, the abbreviation generation process is performed on the subject concerned using the mapping rule corresponding to the abbreviation rule base to determine the subject abbreviation corresponding to the subject concerned; If the subject involved does not satisfy the mapping rule corresponding to the abbreviation rule library, a pre-trained target abbreviation generation model is used to generate an abbreviation for the subject involved to determine the subject abbreviation corresponding to the subject involved.
5. The event recognition method according to claim 1, characterized in that: The step of clustering all the text data to be identified based on the addresses involved corresponding to the multiple text data to be identified to determine at least one initial address event cluster includes: Determine the target distance between any two addresses corresponding to the text data to be identified according to a preset distance determination algorithm; The text data to be identified corresponding to the involved addresses whose target distances meet the preset distance requirements are clustered into the same event cluster to obtain at least one initial address event cluster.
6. The event recognition method according to claim 1, characterized in that: The similarity clustering of the plurality of to-be-recognized text data corresponding to each initial object event cluster to determine the target object event cluster corresponding to each initial object event cluster includes: Based on the to-be-recognized text data corresponding to the initial object event cluster, determining a first text data and a plurality of second text data; Based on the pre-trained target text vector representation model, performing similarity analysis on each of the second text data and the first text data to obtain target text similarities corresponding to the plurality of second text data; If the target text similarities corresponding to all the second text data are less than the first similarity threshold, the first text data is deleted, and the text data to be identified corresponding to the initial object event cluster is repeatedly executed to determine one first text data and multiple second text data; If there is at least one target text similarity corresponding to the second text data that is not less than the first similarity threshold, then based on the second text data whose target text similarity is greater than the second similarity threshold and the first text data, determining a target object event cluster including the first text data; Based on the initial object event cluster and the target object event cluster, determining the remaining object event clusters and the amount of text data corresponding to the remaining object event clusters; If the amount of the text data is greater than a preset threshold, the remaining object event cluster is updated to the initial object event cluster, and the process of repeatedly performing the process based on the text data to be identified corresponding to the initial object event cluster to determine a first text data and a plurality of second text data; If the amount of text data is not greater than a preset threshold, the execution of the text data to be identified corresponding to the initial object event cluster is stopped, a first text data and a plurality of second text data are determined, and a target object event cluster corresponding to each of the initial object event clusters is obtained.
7. The event recognition method according to claim 1, characterized in that: Before acquiring a plurality of text data to be recognized, the event recognition method further includes: Obtain multiple training text data; Using a preset first vector representation model, a second vector representation model, and a third vector representation model respectively, the plurality of training text data are subjected to vector recall processing to obtain N pieces of recall data corresponding to each of the training text data, the N pieces of recall data including M text sample data, wherein N≥M≥3; Performing statistical analysis on the N pieces of recalled data corresponding to the training text data, sorting the M pieces of text sample data in descending order of the number of occurrences, determining the first L pieces of text sample data as positive samples corresponding to the training text data, and determining the remaining (ML) pieces of text sample data as negative samples corresponding to the training text data, wherein 1<L≤M; Based on the multiple training text data, the positive samples corresponding to each training text data and the negative samples corresponding to each training text data, multiple text triplets are constructed, and the original text vector representation model is trained based on the multiple text triplets to obtain a trained target text vector representation model.
8. An event recognition device, characterized in that: include: A module for acquiring text data to be recognized, used for acquiring a plurality of text data to be recognized; An identification module, used to identify a plurality of text data to be identified, and determine the subject and address involved corresponding to each of the text data to be identified; An initial subject event cluster determination module, based on the subjects involved corresponding to the multiple text data to be identified, clusters all the text data to be identified, and determines at least one initial subject event cluster; An initial address event cluster determination module, based on the addresses involved corresponding to the multiple text data to be identified, clusters all the text data to be identified, and determines at least one initial address event cluster; The similarity clustering module is used to perform similarity clustering on a plurality of text data to be identified corresponding to each initial object event cluster, and determine a target object event cluster corresponding to each initial object event cluster, wherein the initial object event cluster includes the initial subject event cluster and the initial address event cluster.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the event recognition method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the event recognition method according to any one of claims 1 to 7 is implemented.