Template mining method and device based on online log data, equipment and medium

By performing entity identification and clustering on online log data, filtering frequently occurring named entities, constructing an initial graph structure, and calculating modularity, the problem of low template quality was solved, the uniqueness and quality of templates were improved, and the work efficiency of insurance business personnel was enhanced.

CN117034047BActive Publication Date: 2026-04-07CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-06
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing template mining methods produce templates of low quality, which is insufficient to meet the needs of insurance business in the fintech field.

Method used

By performing entity identification on online log data, frequently occurring named entities are selected as target entities, an initial graph structure is constructed, nodes are clustered, modularity is calculated, and a template is constructed based on the modularity threshold.

Benefits of technology

This improved the uniqueness and quality of the templates, thereby increasing the work efficiency of insurance sales personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117034047B_ABST
    Figure CN117034047B_ABST
Patent Text Reader

Abstract

This invention relates to the fintech field, and particularly to a method, apparatus, device, and medium for template mining based on online log data. The invention performs entity recognition and filtering on sentences in log data to obtain target entities, constructs an initial graph structure including nodes, edges between nodes, and weights, clusters all nodes to obtain N entity cluster sets, calculates the modularity of each entity cluster set, and if the sum of the modularities of the N entity cluster sets is greater than a preset threshold, constructs templates for the corresponding entity cluster sets based on the target entities corresponding to the nodes in the N entity cluster sets, resulting in N templates. By identifying frequently occurring named entities as target entities, the uniqueness of the templates is improved. The clustering quality of the entity cluster sets is evaluated through modularity, thus improving the quality of the corresponding templates. This effectively improves the work efficiency of business personnel in the insurance industry within the fintech field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention is applicable to the field of financial technology, and in particular relates to a method, apparatus, device and medium for template mining based on online log data. Background Technology

[0002] Log data records procedural events generated by internet systems. By viewing log data, one can understand which specific user, at what specific time, on which specific device or application system, performed what specific operation. By acquiring a dataset containing at least one log data set, one can analyze the behavior of relevant users over a historical period, obtain behavioral information, and then mine templates through behavioral information. These templates can guide user behavior in multiple fields such as finance, healthcare, education, and the internet, demonstrating significant practical value.

[0003] For example, in the insurance business scenario within the fintech field, although insurance business is complex and diverse, there are many commonalities between different insurance services. Sales personnel can use the same or similar scripts to answer different questions raised by customers, thereby improving work efficiency. Because insurance business has strict requirements for the accuracy of text, controllable, fast, and easy-to-edit templates have become important text output tools.

[0004] To discover high-quality templates, existing technologies mine frequently combined words to obtain combined feature templates, thereby enhancing the expressive power of the text and improving template quality. However, these methods only focus on the combined features between words, resulting in very limited template coverage and significantly reducing template quality, making it difficult to meet user needs.

[0005] Therefore, in the insurance business scenario within the fintech field, improving the quality of templates has become an urgent issue to be addressed. Summary of the Invention

[0006] In view of this, embodiments of the present invention provide a template mining method, apparatus, device and medium based on online log data to solve the problem of low template quality obtained by existing template mining methods.

[0007] In a first aspect, embodiments of the present invention provide a template mining method based on online log data, the template mining method comprising:

[0008] Obtain a dataset containing at least one log data, perform entity recognition on sentences in each log data to obtain corresponding named entities, count the frequency of each identical named entity in the dataset, and filter all named entities according to the frequency to obtain the target entity;

[0009] For any two target entities, calculate the similarity between the two target entities, treat each target entity as a node, and use the similarity as the weight of the edge connecting the two target entities. Traverse all target entities to obtain an initial graph structure containing nodes, edges, and weights.

[0010] Cluster all nodes in the initial graph structure to obtain N entity cluster sets. Count the first number of edges between all nodes, the second number of edges between nodes in each entity cluster set and the sum of edge weights, where N is an integer greater than 0.

[0011] For any entity cluster set, calculate the ratio of the second quantity of the entity cluster set to the first quantity to obtain the first module parameter; calculate the ratio of the sum of the weights of the entity cluster set to the first quantity to obtain the second module parameter; and perform a weighted summation of the squares of the first module parameter and the second module parameter to obtain the modularity of the entity cluster set.

[0012] Traverse all entity cluster sets to obtain N modularity values. Compare the sum of the N modularity values ​​with a preset threshold. If the sum of the modularity values ​​is greater than the preset threshold, construct templates for corresponding entity cluster sets based on the target entities corresponding to the nodes in the N entity cluster sets, and obtain N templates.

[0013] Secondly, embodiments of the present invention provide a template mining device based on online log data, the template mining device comprising:

[0014] The entity filtering module is used to acquire a dataset including at least one log data, perform entity recognition on sentences in each log data to obtain the corresponding named entities, count the frequency of each identical named entity in the dataset, and filter all named entities according to the frequency to obtain the target entity.

[0015] The graph structure construction module is used to calculate the similarity between any two target entities, treat each target entity as a node, use the similarity as the weight of the edge connecting the two target entities, traverse all target entities, and obtain an initial graph structure containing nodes, edges and weights.

[0016] The node clustering module is used to cluster all nodes in the initial graph structure to obtain N entity cluster sets, count the first number of edges between all nodes, and the second number of edges between nodes in each entity cluster set and the sum of edge weights, where N is an integer greater than 0.

[0017] The modularity calculation module is used to calculate the ratio of the second quantity to the first quantity of any entity cluster set to obtain the first modularity parameter, calculate the ratio of the sum of weights of the entity cluster set to the first quantity to obtain the second modularity parameter, and perform a weighted summation of the squares of the first modularity parameter and the second modularity parameter to obtain the modularity of the entity cluster set.

[0018] The template mining module is used to traverse all entity cluster sets to obtain N modularity. The sum of the N modularity is compared with a preset threshold. If the sum of the modularity is greater than the preset threshold, a template for the corresponding entity cluster set is constructed based on the target entity corresponding to the node in the N entity cluster sets, thus obtaining N templates.

[0019] Thirdly, embodiments of the present invention provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the template mining method as described in the first aspect.

[0020] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the template mining method as described in the first aspect.

[0021] The beneficial effects of this invention compared to existing technologies are as follows: Entity recognition is performed on sentences in each log data to obtain corresponding named entities. Target entities are obtained by filtering based on the frequency of their occurrence in the dataset. For any two target entities, the similarity between them is calculated. Each target entity is treated as a node, and the similarity is used as the weight of the edge connecting the two target entities. All target entities are traversed to obtain an initial graph structure containing nodes, edges, and weights. All nodes in the initial graph structure are clustered to obtain N entity cluster sets. For any entity cluster set, the ratio of the second number to the first number of entity cluster sets is calculated to obtain the first module parameters. The sum of the weights of the entity cluster sets is then calculated. The ratio of the first quantity is used to obtain the second module parameter. The squares of the first and second module parameters are weighted and summed to obtain the modularity of the entity cluster set. All entity cluster sets are traversed to obtain N modularities. If the sum of the N modularities is greater than a preset threshold, templates for the corresponding entity cluster sets are constructed based on the target entities corresponding to the nodes in the N entity cluster sets, resulting in N templates. By identifying several frequently named entities as target entities, the uniqueness of the templates is improved. By clustering the target entities and evaluating the clustering quality of the entity cluster sets based on the modularity, the clustering quality of the N entity cluster sets is improved, thereby improving the quality of the corresponding templates. This effectively improves the work efficiency of business personnel in the insurance industry of the fintech field. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic diagram of an application environment for a template mining method based on online log data provided in Embodiment 1 of the present invention;

[0024] Figure 2 This is a flowchart illustrating a template mining method based on online log data provided in Embodiment 1 of the present invention;

[0025] Figure 3 This is a schematic diagram of the structure of a template mining device based on online log data provided in Embodiment 2 of the present invention;

[0026] Figure 4 This is a schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Detailed Implementation

[0027] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.

[0028] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0029] It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0030] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0031] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0032] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0033] The embodiments of this invention can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that utilize digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0034] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0035] It should be understood that the sequence number of each step in the following embodiments does not imply 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 embodiments of the present invention.

[0036] To illustrate the technical solution of the present invention, specific embodiments are described below.

[0037] The template mining method based on online log data provided in Embodiment 1 of this invention can be applied to, for example... Figure 1 In this application environment, the client communicates with the server. Clients include, but are not limited to, handheld computers, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, and personal digital assistants (PDAs). The server can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0038] See Figure 2 This is a flowchart illustrating a template mining method based on online log data provided in Embodiment 1 of the present invention. The template mining method described above can be applied to... Figure 1 For clients in the database, the template mining method may include the following steps:

[0039] Step S201: Obtain a dataset including at least one log data, perform entity recognition on the sentences in each log data to obtain the corresponding named entities, count the frequency of each identical named entity in the dataset, filter all named entities according to the frequency to obtain the target entity.

[0040] Log data records procedural events generated by internet systems. By reviewing log data, one can understand which specific user, at what time, on which device or application system, performed what specific action. By acquiring a dataset containing at least one log data point, one can analyze the behavior of relevant users over a historical period, obtaining behavioral information. This behavioral information can then be used to mine templates to guide user behavior.

[0041] In the field of natural language processing, extracting words that represent the full information of a text is a current hot topic. Therefore, named entity recognition technology plays a crucial role in text search, text recommendation, knowledge graph construction, and machine-based intelligent question answering. An entity refers to an objectively existing and distinguishable thing; it can be a specific person, event, or object, or a concept. A named entity is an entity identified by its name. Entity types are concepts defined by humans based on needs. Common entity types include person names, place names, organization names, time dates, product names, etc., used to distinguish the categories of named entities for differentiated treatment and use.

[0042] Therefore, in order to extract effective information that can represent user behavior from log data, this embodiment performs entity recognition on sentences in each log data to obtain corresponding named entities. Then, in order to filter out more important named entities, this embodiment counts the frequency of each identical named entity in the dataset, filters all named entities based on frequency, and selects several named entities with high frequency as target entities to ensure the uniqueness of the template.

[0043] Specifically, the number of target entities selected can be set according to the actual situation. For example, a frequency threshold can be set according to the actual situation, and named entities with a frequency greater than the frequency threshold can be identified as target entities. Alternatively, all named entities can be sorted according to frequency to obtain a sorting result, and the named entities with the highest corresponding frequency in the sorting result can be selected as target entities.

[0044] In one implementation, taking the mining of question-and-answer templates in the insurance industry within the fintech sector as an example, the log data can be relevant data from Q&A exchanges between sales personnel and customers during their work, including question text and answer text. Entity recognition is then performed on sentences in the question and answer texts to obtain corresponding named entities. The frequency of each identical named entity in the dataset is counted, and all named entities are filtered based on frequency to obtain target question-and-answer entities. This serves as the basis for mining question-and-answer templates in the insurance industry, thereby improving the work efficiency of sales personnel.

[0045] Optionally, the frequency of each identical named entity in the dataset can be counted, and all named entities can be filtered based on frequency to obtain the target entities, including:

[0046] Determine the total number of sentences in the dataset;

[0047] For any named entity, the third number of sentences containing the named entity in the statistical data set is counted, and the ratio of the third number to the total number is determined as the frequency of the named entity in the dataset.

[0048] Iterate through all named entities to obtain the frequency of each named entity in the dataset;

[0049] Sort all named entities according to frequency, obtain the sorting results, and select the named entities with the highest corresponding frequency in the sorting results as the target entities.

[0050] The more sentences a named entity appears in in the dataset, the more important that named entity is. Therefore, the frequency of a named entity in the dataset is represented by the ratio of the number of sentences containing that named entity to the total number of sentences in the dataset. All named entities are then sorted according to frequency, and the named entities with the highest frequency in the sorted results (with a predetermined number of occurrences) are selected as the target entities. The specific value of the predetermined number can be set according to actual needs.

[0051] This embodiment uses the ratio of the number of sentences containing named entities in the dataset to the total number of sentences in the dataset to characterize the frequency of the named entity in the dataset. The importance of the corresponding named entity is represented by the magnitude of the frequency, thereby filtering the named entities and improving the accuracy of the target entities.

[0052] The above steps involve obtaining a dataset containing at least one log data, performing entity recognition on sentences in each log data to obtain corresponding named entities, counting the frequency of each identical named entity in the dataset, filtering all named entities based on frequency to obtain target entities, extracting effective information that can characterize user behavior from the log data, and filtering all named entities based on their frequency to determine several high-frequency named entities as target entities, which serve as the basis for mining templates, thereby improving the uniqueness of the templates.

[0053] Step S202: For any two target entities, calculate the similarity between the two target entities, treat each target entity as a node, and use the similarity as the weight of the edge connecting the two target entities. Traverse all target entities to obtain an initial graph structure containing nodes, edges and weights.

[0054] Since entity recognition is performed on sentences based on set entity types, the selected target entities correspond to different entity types. When mining templates based on target entities, target entities of different entity types may be used to form the same template. Therefore, it is necessary to further cluster the target entities to improve the correlation between target entities in the entity cluster set and reduce the recognition error rate of target entities in entity recognition, so as to mine templates based on high-quality entity cluster sets and thus improve template quality.

[0055] The higher the similarity between target entities, the higher the probability that the corresponding target entities belong to the same entity cluster set. When clustering target entities, an initial graph structure is first constructed. Specifically, for any two target entities, the similarity between the two target entities is calculated, and each target entity is treated as a node. The similarity is used as the weight of the edge connecting the two target entities. By traversing all target entities, an initial graph structure containing nodes, edges, and weights is obtained, which serves as the basis for clustering target entities.

[0056] In one implementation, taking the mining of question-and-answer templates in the insurance industry within the fintech field as an example, the similarity between any two target question-and-answer entities is calculated. Each target question-and-answer entity is treated as a node, and the similarity is used as the weight of the edge connecting the two target question-and-answer entities. All target question-and-answer entities are traversed to obtain an initial graph structure containing nodes, edges, and weights, which serves as the basis for clustering target question-and-answer entities. This results in a high-quality set of entity clusters for mining question-and-answer templates, thereby improving the quality of the question-and-answer templates.

[0057] The above steps involve calculating the similarity between any two target entities, treating each target entity as a node, using the similarity as the weight of the edge connecting the two target entities, traversing all target entities, and obtaining an initial graph structure containing nodes, edges, and weights. This initial graph structure serves as the basis for clustering target entities. By clustering target entities, the correlation between target entities in the entity cluster set can be improved, resulting in a high-quality entity cluster set for template mining, thereby improving the quality of the template.

[0058] Step S203: Cluster all nodes in the initial graph structure to obtain N entity cluster sets, count the first number of edges between all nodes, and the second number of edges between nodes in each entity cluster set and the sum of edge weights.

[0059] In this process, all nodes in the initial graph structure are clustered to obtain N entity cluster sets. Target entities in the same cluster set have high similarity and correlation and can be used to construct the same type of template. Therefore, the target entities in each entity cluster set are used as the basis for constructing the corresponding template.

[0060] To improve the quality of the mined templates, this embodiment evaluates the clustering quality of N entity cluster sets before template construction. If the clustering quality meets the high-quality requirements, a high-quality entity cluster set is used for template construction, thereby improving the quality of the mined templates. Specifically, this embodiment counts the first number of edges between all nodes, and the second number of edges between nodes in each entity cluster set, along with the sum of the edge weights, as the basis for evaluating the clustering quality of the entity cluster sets.

[0061] In one implementation, taking the mining of question-and-answer templates in the insurance industry within the fintech field as an example, correspondingly, all nodes in the initial graph structure are clustered to obtain N question-and-answer entity cluster sets. The first number of edges between all nodes, and the second number of edges between nodes in each question-and-answer entity cluster set and the sum of edge weights are counted as the basis for evaluating the clustering quality of the question-and-answer entity cluster sets. When the clustering quality meets the high-quality requirements, the high-quality question-and-answer entity cluster sets are used to construct question-and-answer templates, thereby improving the quality of the mined question-and-answer templates.

[0062] Optionally, all nodes in the initial graph structure are clustered to obtain N entity cluster sets, including:

[0063] Each node in the initial graph structure is identified as an entity cluster set;

[0064] The clustering process includes:

[0065] For any given node, identify several neighboring nodes that are not in the same entity cluster set as the node. For any given neighboring node, assign the node to the entity cluster set corresponding to the neighboring node and calculate the first modularity of the corresponding entity cluster set.

[0066] Traverse all neighboring nodes to obtain several first modularity values. Compare the largest first modularity value with the modularity threshold to obtain the comparison result. Optimize the entity cluster set corresponding to the node based on the comparison result.

[0067] Each of the optimized entity cluster sets is treated as an optimized node. The second similarity between any two optimized nodes is calculated. The second similarity is used as the second weight of the edge connecting any two optimized nodes. All optimized nodes are traversed to obtain an optimized graph structure containing optimized nodes, edges, and the second weight.

[0068] The clustering process is used to cluster several optimized nodes in the optimized graph structure to obtain several further optimized entity cluster sets. This process is repeated until the entity cluster sets corresponding to all target entities no longer change, resulting in N entity cluster sets.

[0069] Before clustering, each target entity belongs to a separate set. Therefore, in the initial graph structure, each node is identified as an entity cluster set, and clustering is performed on all nodes in the initial graph structure. The specific clustering process includes:

[0070] For any given node, first identify several neighboring nodes that are not in the same entity cluster set as the node, and determine whether the node can be assigned to the entity cluster set corresponding to a certain neighboring node, so as to optimize the entity cluster set corresponding to the node.

[0071] Specifically, for any neighboring node, the node is assigned to the entity cluster set corresponding to the neighboring node, and the first modularity of the corresponding entity cluster set is calculated. The first modularity is used to measure the clustering quality of the entity cluster set after the node is assigned to the entity cluster set corresponding to the neighboring node. Then, all neighboring nodes are traversed to obtain several first modularities. The largest first modularity is compared with the modularity threshold to obtain the comparison result. The entity cluster set corresponding to the node is optimized based on the comparison result.

[0072] In one implementation, if the comparison result is that the largest first modularity is greater than the modularity threshold, or the largest first modularity is less than or equal to the modularity threshold, then if the comparison result is that the largest first modularity is greater than the modularity threshold, the node is assigned to the entity cluster set corresponding to the neighbor node with the largest first modularity, thus obtaining an optimized entity cluster set; if the comparison result is that the largest first modularity is less than or equal to the modularity threshold, then the entity cluster sets corresponding to the node and the neighbor node are not changed.

[0073] Then, traverse all nodes and optimize the entity cluster set corresponding to each node to obtain several optimized entity cluster sets.

[0074] Then, each of the optimized entity cluster sets is treated as an optimized node. The second similarity between any two optimized nodes is calculated, and the second similarity is used as the second weight of the edge connecting any two optimized nodes. All optimized nodes are traversed to obtain an optimized graph structure containing optimized nodes, edges, and the second weight. Several optimized nodes in the optimized graph structure are then clustered according to the clustering process to obtain several further optimized entity cluster sets. This process is repeated until the entity cluster sets corresponding to all target entities no longer change, resulting in N entity cluster sets. The N entity cluster sets obtained are the entity cluster sets with the highest quality.

[0075] This embodiment uses modularity to characterize the clustering quality of the corresponding entity cluster set. It optimizes all nodes in the initial graph structure separately and in multiple rounds to obtain the N entity cluster sets with the highest quality, thereby improving the quality of the question-and-answer templates obtained from mining.

[0076] Optionally, the largest first modularity and the modularity threshold are compared to obtain the following comparison results:

[0077] Calculate the second modularity of the entity cluster set corresponding to the node in the initial graph structure, and the third modularity of the entity cluster set corresponding to the neighbor node corresponding to the largest first modularity;

[0078] Calculate the sum of the second modularity, the third modularity, and the preset value to obtain the modularity threshold;

[0079] Compare the largest first modularity with the modularity threshold to obtain the comparison result. The comparison result is that the largest first modularity is greater than the modularity threshold, or the largest first modularity is less than or equal to the modularity threshold.

[0080] The modularity threshold is used to compare with the modularity of the entity cluster set in the clustering process to measure whether the corresponding entity cluster set can be used as the optimized entity cluster set. The entity cluster set corresponding to the node can be optimized based on the comparison result.

[0081] Since the entity cluster set for any node is formed by combining the node and the neighboring nodes corresponding to the largest first modularity, the modularity threshold is the sum of the second modularity of the entity cluster set corresponding to the node, the third modularity of the entity cluster set corresponding to the neighboring nodes corresponding to the largest first modularity, and a preset value. This preset value can be set according to the actual situation to ensure that the optimized entity cluster set has higher clustering quality than the entity cluster set before optimization.

[0082] Then compare the largest first modularity with the modularity threshold to obtain the comparison result. Correspondingly, the comparison result is that the largest first modularity is greater than the modularity threshold, or the largest first modularity is less than or equal to the modularity threshold.

[0083] In this embodiment, the second modularity of the entity cluster set corresponding to the node, the third modularity of the entity cluster set corresponding to the neighbor node corresponding to the largest first modularity, and the sum of the preset value are used as the modularity threshold. During the clustering process of the target entity, the modularity threshold is dynamically determined to measure whether the corresponding entity cluster set can be used as the optimized entity cluster set, thereby improving the clustering accuracy of the target entity and improving the quality of the obtained N entity cluster sets.

[0084] The steps described above involve clustering all nodes in the initial graph structure to obtain N entity cluster sets, counting the first number of edges between all nodes, and the second number of edges between nodes in each entity cluster set, along with the sum of edge weights. By clustering all nodes in the initial graph structure, N high-quality entity cluster sets are obtained. The target entities in each entity cluster set are used as the basis for constructing the corresponding template, and the clustering quality of the entity cluster sets is evaluated to ensure the clustering quality of the entity cluster sets, thereby improving the quality of the corresponding templates.

[0085] Step S204: For any entity cluster set, calculate the ratio of the second quantity to the first quantity of the entity cluster set to obtain the first module parameter; calculate the ratio of the sum of the weights of the entity cluster set to the first quantity to obtain the second module parameter; and perform a weighted summation of the squares of the first module parameter and the second module parameter to obtain the modularity of the entity cluster set.

[0086] In this embodiment, for any entity cluster set, the ratio of the second quantity to the first quantity of the entity cluster set is calculated to obtain the first module parameter, which is used to characterize the probability of generating edges within the entity cluster set under actual conditions. The ratio of the sum of the weights of the entity cluster set to the first quantity is then calculated to obtain the second module parameter, which is used to characterize the expected probability of generating edges within the entity cluster set under ideal conditions. Then, the squares of the first and second module parameters are weighted and summed to obtain the modularity of the entity cluster set. The modularity characterizes the clustering quality of the entity cluster set; correspondingly, the larger the modularity, the higher the clustering quality of the corresponding entity cluster set.

[0087] In one embodiment, taking the mining of question-and-answer templates in the insurance industry within the fintech field as an example, for any question-and-answer entity cluster set, the ratio of the second quantity to the first quantity of the question-and-answer entity cluster set is calculated to obtain the first module parameter. The ratio of the sum of the weights of the question-and-answer entity cluster set to the first quantity is calculated to obtain the second module parameter. The squares of the first module parameter and the second module parameter are weighted and summed to obtain the modularity of the question-and-answer entity cluster set, which characterizes the clustering quality of the question-and-answer entity cluster set. Correspondingly, the larger the modularity, the higher the clustering quality of the corresponding question-and-answer entity cluster set.

[0088] Optionally, calculating the second modularity of the entity cluster set corresponding to a node in the initial graph structure, and the third modularity of the entity cluster set corresponding to the neighbor node corresponding to the node with the highest first modularity, includes:

[0089] The third number of edges between all nodes in the initial graph structure, the fourth number of edges between nodes in the entity cluster set corresponding to the node and the sum of the second weights of the edges, and the fifth number of edges between nodes in the entity cluster set corresponding to the neighboring node and the sum of the third weights of the edges are calculated.

[0090] Calculate the ratio of the fourth quantity to the third quantity to obtain the third module parameter; calculate the ratio of the sum of the second weights to the third quantity to obtain the fourth module parameter; and perform a weighted sum of the squares of the third module parameter and the fourth module parameter to obtain the second module degree of the entity cluster set corresponding to the node.

[0091] Calculate the ratio of the fifth quantity to the third quantity to obtain the fifth module parameter. Calculate the ratio of the sum of the third weights to the third quantity to obtain the sixth module parameter. Perform a weighted sum of the squares of the fifth module parameter and the sixth module parameter to obtain the third module degree of the entity cluster set corresponding to the neighbor node.

[0092] In the clustering process of target entities, the second modularity is used to characterize the clustering quality of the entity cluster set corresponding to the node in the initial graph structure, and the third modularity is used to represent the clustering quality of the entity cluster set corresponding to the neighbor node with the largest first modularity in the initial graph structure. The second modularity and the third modularity are calculated respectively as the basis for calculating the dynamic modularity threshold, thereby improving the optimization quality of the entity cluster set and thus improving the quality of the N entity cluster sets and the question-answering templates obtained by mining.

[0093] The above steps, for any entity cluster set, calculate the ratio of the second quantity to the first quantity of the entity cluster set to obtain the first module parameter, calculate the ratio of the sum of the weights of the entity cluster set to the first quantity to obtain the second module parameter, and perform a weighted sum of the squares of the first module parameter and the second module parameter to obtain the modularity of the entity cluster set. By calculating the modularity, the clustering quality of the entity cluster set is characterized, which serves as a measure of whether the obtained N entity cluster sets can be used as the basis for template mining, effectively improving the rationality of template mining.

[0094] Step S205: Traverse all entity cluster sets to obtain N modularity values. Compare the sum of the N modularity values ​​with a preset threshold. If the sum of the modularity values ​​is greater than the preset threshold, construct templates for the corresponding entity cluster sets based on the target entities corresponding to the nodes in the N entity cluster sets, and obtain N templates.

[0095] This process involves iterating through all entity cluster sets to obtain N modularity values, each representing the clustering quality of the N entity cluster sets. The sum of the N modularity values ​​is then calculated and compared with a preset threshold. If the sum of the modularity values ​​is greater than the preset threshold, then the N entity cluster sets obtained by clustering meet the high-quality requirements. Templates for corresponding entity cluster sets can be constructed based on the target entities corresponding to the nodes in the N entity cluster sets, resulting in N high-quality templates.

[0096] In one implementation, taking the mining of question-and-answer templates in the insurance industry within the fintech field as an example, the process involves traversing all question-and-answer entity cluster sets to obtain N modularity values. The sum of the N modularity values ​​is compared with a preset threshold. If the sum of the modularity values ​​is greater than the preset threshold, a question-and-answer template for the corresponding question-and-answer entity cluster set is constructed based on the target question-and-answer entity corresponding to the node in the N question-and-answer entity cluster sets. This results in N question-and-answer templates, which are used to guide and assist business personnel in their work, thereby improving their work quality and efficiency.

[0097] The above process iterates through all entity cluster sets to obtain N modularity values. The sum of the N modularity values ​​is compared with a preset threshold. If the sum of the modularity values ​​is greater than the preset threshold, a template for the corresponding entity cluster set is constructed based on the target entity corresponding to the node in the N entity cluster sets, resulting in N templates. Before constructing the templates, the clustering quality of the N entity cluster sets obtained by clustering is measured to construct high-quality templates based on high-quality entity cluster sets, effectively improving the quality of the templates.

[0098] This invention performs entity recognition on sentences in each log data to obtain corresponding named entities. Target entities are then filtered based on their frequency of occurrence in the dataset. For any two target entities, their similarity is calculated. Each target entity is treated as a node, and the similarity is used as the weight of the edge connecting the two target entities. All target entities are traversed to obtain an initial graph structure containing nodes, edges, and weights. All nodes in the initial graph structure are clustered to obtain N entity cluster sets. For any entity cluster set, the ratio of the second number to the first number of entity cluster sets is calculated to obtain the first module parameter. Finally, the ratio of the sum of the weights of the entity cluster sets to the first number is calculated to obtain... The second module parameter is used to calculate the modularity of the entity cluster set by weighted summation of the squares of the first and second module parameters. This process iterates through all entity cluster sets to obtain N modularities. If the sum of the N modularities exceeds a preset threshold, templates for corresponding entity cluster sets are constructed based on the target entities corresponding to the nodes in the N entity cluster sets. This results in N templates. By identifying several frequently occurring named entities as target entities, the uniqueness of the templates is improved. By clustering the target entities and evaluating the clustering quality of the entity cluster sets based on the modularity, the clustering quality of the N entity cluster sets is improved, thereby enhancing the quality of the corresponding templates. This effectively improves the work efficiency of business personnel in the insurance industry within the fintech sector.

[0099] Corresponding to the template mining method in the above embodiments, Figure 3 A structural block diagram of the template excavation device provided in Embodiment 2 of the present invention is given. For ease of explanation, only the parts related to the embodiments of the present invention are shown.

[0100] See Figure 3 The template excavation device includes:

[0101] The entity filtering module 31 is used to acquire a dataset including at least one log data, perform entity recognition on sentences in each log data to obtain the corresponding named entities, count the frequency of each identical named entity in the dataset, filter all named entities according to the frequency, and obtain the target entity.

[0102] The graph structure construction module 32 is used to calculate the similarity between any two target entities, treat each target entity as a node, use the similarity as the weight of the edge connecting the two target entities, traverse all target entities, and obtain an initial graph structure containing nodes, edges and weights.

[0103] The node clustering module 33 is used to cluster all nodes in the initial graph structure to obtain N entity cluster sets, count the first number of edges between all nodes, and the second number of edges between nodes in each entity cluster set and the sum of edge weights, where N is an integer greater than 0.

[0104] The modularity calculation module 34 is used to calculate the ratio of the second quantity to the first quantity of any entity cluster set to obtain the first module parameter, calculate the ratio of the sum of the weights of the entity cluster set to the first quantity to obtain the second module parameter, and perform a weighted summation of the squares of the first module parameter and the second module parameter to obtain the modularity of the entity cluster set.

[0105] Template mining module 35 is used to traverse all entity cluster sets to obtain N modularity. It compares the sum of the N modularity with a preset threshold. If the sum of the modularity is greater than the preset threshold, it constructs a template for the corresponding entity cluster set based on the target entity corresponding to the node in the N entity cluster sets, thus obtaining N templates.

[0106] Optionally, the entity filtering module 31 mentioned above includes:

[0107] The total number determination submodule is used to determine the total number of sentences in the dataset;

[0108] The first frequency calculation submodule is used to count the third number of sentences in the dataset that include the named entity for any named entity, and determine the frequency of the named entity in the dataset by the ratio of the third number to the total number.

[0109] The second frequency calculation submodule is used to traverse all named entities and obtain the frequency of each named entity in the dataset.

[0110] The entity filtering submodule is used to sort all named entities according to frequency, obtain the sorting results, and select the named entities with the highest corresponding frequency in the sorting results as the target entities.

[0111] Optionally, the above-mentioned node clustering module 33 includes:

[0112] The first set determination submodule is used to determine each node in the initial graph structure as an entity cluster set;

[0113] The modularity calculation submodule is used to determine, for any given node, several neighboring nodes that are not in the same entity cluster set as the node, assign the node to the entity cluster set corresponding to the neighboring node for any given neighboring node, and calculate the first modularity of the corresponding entity cluster set.

[0114] The first set optimization submodule is used to traverse all neighbor nodes, obtain several first modularity, compare the largest first modularity with the modularity threshold, obtain the comparison result, and optimize the entity cluster set corresponding to the node based on the comparison result;

[0115] The second set optimization submodule is used to traverse all nodes and optimize the entity cluster sets corresponding to all nodes to obtain several optimized entity cluster sets.

[0116] The third set optimization submodule is used to treat each of the optimized entity cluster sets as an optimized node, calculate the second similarity between any two optimized nodes, use the second similarity as the second weight of the edge connecting any two optimized nodes, traverse all optimized nodes, and obtain an optimized graph structure containing optimized nodes, edges and the second weight.

[0117] The fourth set optimization submodule is used to cluster several optimized nodes in the optimized graph structure according to the clustering process, to obtain several entity cluster sets after further optimization, and so on, until the entity cluster sets corresponding to all target entities no longer change, resulting in N entity cluster sets.

[0118] Optionally, the aforementioned first set optimization submodule includes:

[0119] The modularity calculation unit is used to calculate the second modularity of the entity cluster set corresponding to the node in the initial graph structure, and the third modularity of the entity cluster set corresponding to the neighbor node corresponding to the largest first modularity.

[0120] The threshold calculation unit is used to calculate the sum of the second modularity, the third modularity, and the preset value to obtain the modularity threshold.

[0121] The modularity comparison unit is used to compare the maximum first modularity with the modularity threshold to obtain a comparison result. The comparison result is that the maximum first modularity is greater than the modularity threshold, or the maximum first modularity is less than or equal to the modularity threshold.

[0122] Optionally, the aforementioned first set optimization submodule includes:

[0123] The first set optimization unit is used to assign the node to the entity cluster set corresponding to the neighbor node with the largest first modularity if the comparison result is greater than the modularity threshold, so as to obtain the optimized entity cluster set.

[0124] The second set optimization unit is used to not change the entity cluster set corresponding to the node and its neighboring nodes if the comparison result shows that the largest first modularity is less than or equal to the modularity threshold.

[0125] Optionally, the above-mentioned modularity calculation unit includes:

[0126] The data statistics subunit is used to count the third number of edges between all nodes in the initial graph structure, the fourth number of edges between nodes in the entity cluster set corresponding to the node and the sum of the second weights of the edges, and the fifth number of edges between nodes in the entity cluster set corresponding to the neighboring node and the sum of the third weights of the edges.

[0127] The second modularity calculation subunit is used to calculate the ratio of the fourth quantity to the third quantity to obtain the third modularity parameter, calculate the ratio of the sum of the second weights to the third quantity to obtain the fourth modularity parameter, and perform a weighted summation of the squares of the third and fourth modularity parameters to obtain the second modularity of the entity cluster set corresponding to the node.

[0128] The third module degree calculation subunit is used to calculate the ratio of the fifth quantity to the third quantity to obtain the fifth module parameter, calculate the ratio of the sum of the third weights to the third quantity to obtain the sixth module parameter, and perform a weighted summation of the squares of the fifth module parameter and the sixth module parameter to obtain the third module degree of the entity cluster set corresponding to the neighbor node.

[0129] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.

[0130] Figure 4 This is a schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Figure 4 As shown, the computer device of this embodiment includes: at least one processor ( Figure 4 Only one is shown in the diagram), a memory, and a computer program stored in the memory and capable of running on at least one processor, which, when executing the computer program, implements the steps in any of the above-described template mining method embodiments.

[0131] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 4 The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown in the illustration, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.

[0132] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0133] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of a computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.

[0134] Those skilled in the art will understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the functions described above can be assigned to 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. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this invention. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the methods of the above embodiments by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0135] The present invention can implement all or part of the processes in the methods of the above embodiments, or it can be accomplished by a computer program product. When the computer program product is run on a computer device, the computer device executes the steps in the above method embodiments.

[0136] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0137] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0138] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0139] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0140] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A template mining method based on online log data, characterized in that, The template mining method includes: Obtain a dataset containing at least one log data, perform entity recognition on sentences in each log data to obtain corresponding named entities, count the frequency of each identical named entity in the dataset, and filter all named entities according to the frequency to obtain the target entity; For any two target entities, calculate the similarity between the two target entities, treat each target entity as a node, and use the similarity as the weight of the edge connecting the two target entities. Traverse all target entities to obtain an initial graph structure containing nodes, edges, and weights. Cluster all nodes in the initial graph structure to obtain N entity cluster sets. Count the first number of edges between all nodes, the second number of edges between nodes in each entity cluster set and the sum of edge weights, where N is an integer greater than 0. For any entity cluster set, the ratio of the second quantity to the first quantity of the entity cluster set is calculated to obtain the first module parameter. The ratio of the sum of the weights of the entity cluster set to the first quantity is calculated to obtain the second module parameter. The squares of the first module parameter and the second module parameter are weighted and summed to obtain the modularity of the entity cluster set. The modularity is used to characterize the clustering quality of the entity cluster set. Traverse all entity cluster sets to obtain N modularity values. Compare the sum of the N modularity values ​​with a preset threshold. If the sum of the modularity values ​​is greater than the preset threshold, construct templates for corresponding entity cluster sets based on the target entities corresponding to the nodes in the N entity cluster sets to obtain N templates. The process of clustering all nodes in the initial graph structure yields N entity cluster sets, including: Each node in the initial graph structure is identified as an entity cluster set; The clustering process includes: For any given node, identify several neighboring nodes that are not in the same entity cluster set as the given node. For any given neighboring node, assign the node to the entity cluster set corresponding to the neighboring node. Calculate the first modularity of the corresponding entity cluster set. The first modularity is used to measure the clustering quality of the corresponding entity cluster set after the node is assigned to the entity cluster set corresponding to the neighboring node. Traverse all neighbor nodes to obtain several first modularity values. Compare the largest first modularity value with the modularity threshold to obtain the comparison result. Optimize the entity cluster set corresponding to the node based on the comparison result. Traverse all nodes and optimize the entity cluster set corresponding to each node to obtain several optimized entity cluster sets; Each of the optimized entity cluster sets is regarded as an optimized node. The second similarity between any two optimized nodes is calculated. The second similarity is used as the second weight of the edge connecting any two optimized nodes. All optimized nodes are traversed to obtain an optimized graph structure containing optimized nodes, edges and the second weight. The clustering process is used to cluster several optimized nodes in the optimized graph structure to obtain several further optimized entity cluster sets. This process is repeated until the entity cluster sets corresponding to all target entities no longer change, resulting in N entity cluster sets.

2. The template mining method according to claim 1, characterized in that, The frequency of each identical named entity appearing in the dataset is counted, and all named entities are filtered based on the frequency to obtain the target entities, including: Determine the total number of sentences in the dataset; For any named entity, count the third number of sentences in the dataset that include the named entity, and determine the ratio of the third number to the total number as the frequency of the named entity in the dataset; Iterate through all named entities and obtain the frequency of each named entity in the dataset. All named entities are sorted according to their frequency to obtain a sorting result. The named entities with the highest corresponding frequency in the sorting result are selected as the target entities.

3. The template mining method according to claim 1, characterized in that, The comparison between the largest first modularity and the modularity threshold yields the following results: Calculate the second modularity of the entity cluster set corresponding to the node in the initial graph structure, and the third modularity of the entity cluster set corresponding to the neighbor node corresponding to the largest first modularity; Calculate the sum of the second modularity, the third modularity, and the preset value to obtain the modularity threshold; The maximum first modularity and the modularity threshold are compared to obtain a comparison result. The comparison result is that the maximum first modularity is greater than the modularity threshold, or the maximum first modularity is less than or equal to the modularity threshold.

4. The template mining method according to claim 3, characterized in that, The optimization of the entity cluster set corresponding to the node based on the comparison result includes: If the comparison result is that the largest first modularity is greater than the modularity threshold, then the node is assigned to the entity cluster set corresponding to the neighbor node of the largest first modularity, and the optimized entity cluster set is obtained. If the comparison result is that the largest first modularity is less than or equal to the modularity threshold, then the entity cluster set corresponding to the node and the neighbor node is not changed.

5. The template mining method according to claim 3, characterized in that, The calculation of the second modularity of the entity cluster set corresponding to the node in the initial graph structure, and the third modularity of the entity cluster set corresponding to the neighbor node corresponding to the largest first modularity, includes: The third number of edges between all nodes in the initial graph structure, the fourth number of edges between nodes in the entity cluster set corresponding to the node and the sum of the second weights of the edges, and the fifth number of edges between nodes in the entity cluster set corresponding to the neighbor node and the sum of the third weights of the edges are calculated. Calculate the ratio of the fourth quantity to the third quantity to obtain the third module parameter; calculate the ratio of the sum of the second weights to the third quantity to obtain the fourth module parameter; and perform a weighted summation of the squares of the third module parameter and the fourth module parameter to obtain the second module degree of the entity cluster set corresponding to the node. Calculate the ratio of the fifth quantity to the third quantity to obtain the fifth module parameter. Calculate the ratio of the sum of the third weights to the third quantity to obtain the sixth module parameter. Perform a weighted summation of the squares of the fifth module parameter and the sixth module parameter to obtain the third module degree of the entity cluster set corresponding to the neighbor node.

6. A template mining device based on online log data, characterized in that, The template excavation device includes: The entity filtering module is used to acquire a dataset including at least one log data, perform entity recognition on sentences in each log data to obtain the corresponding named entities, count the frequency of each identical named entity in the dataset, and filter all named entities according to the frequency to obtain the target entity. The graph structure construction module is used to calculate the similarity between any two target entities, treat each target entity as a node, use the similarity as the weight of the edge connecting the two target entities, traverse all target entities, and obtain an initial graph structure containing nodes, edges and weights. The node clustering module is used to cluster all nodes in the initial graph structure to obtain N entity cluster sets, count the first number of edges between all nodes, and the second number of edges between nodes in each entity cluster set and the sum of edge weights, where N is an integer greater than 0. The modularity calculation module is used to calculate, for any entity cluster set, the ratio of the second quantity to the first quantity of the entity cluster set to obtain the first modularity parameter, calculate the ratio of the sum of the weights of the entity cluster set to the first quantity to obtain the second modularity parameter, and perform a weighted summation of the squares of the first modularity parameter and the second modularity parameter to obtain the modularity of the entity cluster set. The modularity is used to characterize the clustering quality of the entity cluster set. The template mining module is used to traverse all entity cluster sets to obtain N modularity, compare the sum of the N modularity with a preset threshold, and if the sum of the modularity is greater than the preset threshold, construct a template for the corresponding entity cluster set based on the target entity corresponding to the node in the N entity cluster sets to obtain N templates. The node clustering module includes: The first set determination submodule is used to determine each node in the initial graph structure as an entity cluster set; The modularity calculation submodule is used to determine, for any node, several neighboring nodes that are not in the same entity cluster set as the node, assign the node to the entity cluster set corresponding to the neighboring node for any neighboring node, and calculate the first modularity of the corresponding entity cluster set. The first modularity is used to measure the clustering quality of the corresponding entity cluster set after the node is assigned to the entity cluster set corresponding to the neighboring node. The first set optimization submodule is used to traverse all neighbor nodes, obtain several first modularity values, compare the largest first modularity value with the modularity threshold, obtain the comparison result, and optimize the entity cluster set corresponding to the node based on the comparison result. The second set optimization submodule is used to traverse all nodes and optimize the entity cluster sets corresponding to all nodes to obtain several optimized entity cluster sets. The third set optimization submodule is used to treat the optimized entity cluster sets as optimized nodes, calculate the second similarity between any two optimized nodes, use the second similarity as the second weight of the edge connecting any two optimized nodes, traverse all optimized nodes, and obtain an optimized graph structure containing optimized nodes, edges and second weights. The fourth set optimization submodule is used to cluster several optimized nodes in the optimized graph structure according to the clustering process to obtain several entity cluster sets after further optimization, and so on, until the entity cluster sets corresponding to all target entities no longer change, resulting in N entity cluster sets.

7. The template excavation device according to claim 6, characterized in that, The entity filtering module includes: The total number determination submodule is used to determine the total number of sentences in the dataset; The first frequency calculation submodule is used to calculate the third number of sentences in the dataset that include the named entity for any named entity, and determine the ratio of the third number to the total number as the frequency of the named entity in the dataset. The second frequency calculation submodule is used to traverse all named entities and obtain the frequency of each named entity in the dataset. The entity filtering submodule is used to sort all named entities according to the frequency, obtain the sorting result, and select the named entities with the highest corresponding frequency in the sorting result as the target entities.

8. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the template mining method as described in any one of claims 1 to 5.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the template mining method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Question sentence template automatic generation method and apparatus

    CN108038234A

  • Pseudo tag construction method and device for model training, equipment and medium

    CN116206174A