A government affair matter entity linking method, device, system and storage medium
By combining convolutional neural networks and sentence-transformer models, high-precision entity linking of government affairs information was achieved, solving the problem of inconsistent names but identical semantics for government affairs in different provinces and cities, and improving the accuracy of entity linking.
Patent Information
- Application Number
- CN202211384168.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-07
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2042-11-07
AI Technical Summary
The existing methods for linking government affairs entities cannot accurately link situations where the names of items in different provinces and cities are different but actually point to the same government affairs item, resulting in reduced accuracy of entity linking.
A convolutional neural network model and a sentence-transformer pre-trained model are used to train and transform the pairing of government affairs information. By generating a set of candidate government affairs entities and vectors of government affairs information to be linked, the target government affairs pairing model is used to pair them, determine the target government affairs entities, and link them.
It has improved the accuracy of entity links for government affairs items, and reduced the number of situations where government affairs items from different provinces and cities with different names but the same meaning cannot be linked.
Smart Images

Figure CN115794992B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of entity linking technology, and in particular to a method, apparatus, system and storage medium for linking government affairs entities. Background Technology
[0002] Government service items are those offered by various departments and published on government service platforms, such as teacher qualification certification, vehicle registration, and issuance of temporary license plates. Because government service platforms in different provinces and cities are independent, the descriptions of relevant information for government service items published on these platforms vary significantly. In the process of integrating multi-province and municipal government service databases and constructing a knowledge graph, it is necessary to create entity links for items with different names but actually pointing to the same government service item in different provinces and cities. This ensures that a given item can be found and processed on the government service platform of another province or city.
[0003] The current method for linking government affairs items involves comparing the item names and issuing department names of two government affairs items from different provinces and cities. If both the item name and department name are the same, it indicates that the two government affairs items point to the same item. However, when two government affairs items have different names but actually point to the same item, this method cannot accurately link the two items, thus reducing the accuracy of the entity linking. Summary of the Invention
[0004] This application provides a method, apparatus, system, and storage medium for linking entities of government affairs, which can improve the accuracy of linking entities of government affairs.
[0005] The first aspect of this application provides a method for linking entities for government affairs, including:
[0006] Collect a set of government affairs information to be trained, which is a collection of government affairs information to be trained published on government service platforms in different provinces and cities;
[0007] The set of government affairs information to be trained is input into a convolutional neural network model for pairing training to obtain a target government affairs pairing model.
[0008] Obtain information on government affairs items to be linked;
[0009] Generate a candidate set of government affairs entities from the knowledge base, wherein the candidate set of government affairs entities is a collection of candidate government affairs entities from different provinces and cities;
[0010] All candidate government affairs entities in the candidate government affairs entity set are input into the sentence-transformer pre-trained model for vector transformation to obtain a first vector set, which is the set of the first vectors of all candidate government affairs entities;
[0011] The information of the government affairs to be linked is input into the sentence-transformer pre-trained model for vector transformation to obtain the second vector;
[0012] The second vector and any first vector from the first vector set are input into the target government affairs matching model for matching;
[0013] The target government item entity is determined based on the output of the target government item matching model.
[0014] Link the information of the government affairs to be linked to the entity of the target government affairs.
[0015] Optionally, the step of inputting the set of government affairs information to be trained into a convolutional neural network model for pairing training to obtain a target government affairs pairing model includes:
[0016] The training information is paired and labeled with information from different provinces and cities that points to the same government matter, and information from different provinces and cities that does not point to the same government matter. The training information includes the matter name, the name of the application materials, and the legal basis information.
[0017] Extract keyword features from the item names in the government affairs information to be trained;
[0018] The keyword features, application material names, and legal basis information in the government affairs information to be trained are respectively input into the sentence-transformer pre-training model for vector transformation to obtain a third vector set. The third vector set is the set of third vectors corresponding to the keyword features, application material names, and legal basis information in the government affairs information to be trained.
[0019] Using the paired labels as supervision labels, all third vectors in the third vector set are concatenated and input into the convolutional neural network model for iterative training.
[0020] When the convolutional neural network model converges, it is determined that the convolutional neural network model is a target government affairs matching model.
[0021] Optionally, extracting keyword features from the item names in the government affairs information to be trained includes:
[0022] The jieba tool is used to segment the name of the matter in the government affairs information to be trained to obtain an independent word entity set, which is the set of all independent word entities in the matter name;
[0023] Using all the item names in the set of government affairs information to be trained as the corpus, weights are assigned to each independent word entity in the set of independent word entities.
[0024] Calculate the TF-IDF value for each independent word entity based on the weights.
[0025] Independent word entities whose TF-IDF values meet the first preset requirements are identified as keyword features.
[0026] Optionally, the candidate set of government affairs entities for generating the linked government affairs information from the knowledge base includes:
[0027] All candidate government affairs information in the knowledge base is categorized by province and city.
[0028] The information on government affairs to be linked is matched with the information on candidate government affairs from different provinces and cities by name;
[0029] The candidate government affairs information with the same name as the government affairs information to be linked is identified as the first candidate government affairs entity;
[0030] Calculate the LevenshteinDistance edit distance between the government affairs information to be linked and the non-first candidate government affairs entities;
[0031] Entities that are not the first candidate government affairs items and whose calculation results meet the second preset requirements are identified as second candidate government affairs items.
[0032] The set of the first candidate government affairs entities and the second candidate government affairs entities is defined as the candidate government affairs entity set.
[0033] Optionally, the step of inputting all candidate government affairs entities in the candidate government affairs entity set into the sentence-transformer pre-trained model for vector transformation to obtain the first vector set includes:
[0034] Obtain the keyword features of the item names, application material names, and legal basis information of all candidate government affairs entities in the candidate government affairs entity set;
[0035] The keyword features of the item names, application material names, and legal basis information of all candidate government affairs entities are input into the sentence-transformer pre-trained model for vector transformation to obtain a first vector set. The first vector set is the set of first vectors corresponding to the keyword features, application material names, and legal basis information of the item names of all candidate government affairs entities.
[0036] Optionally, the step of inputting the information of the government affairs to be linked into the sentence-transformer pre-trained model for vector transformation to obtain the second vector includes:
[0037] Obtain the keyword characteristics of the name of the government affairs information to be linked, the name of the application materials, and the legal basis information;
[0038] The keyword features of the name of the government affairs information to be linked, the name of the application materials, and the legal basis information are input into the sentence-transformer pre-trained model for vector transformation to obtain the second vector.
[0039] The second aspect of this application provides a physical linking device for government affairs, comprising:
[0040] The data collection unit is used to collect a set of government affairs information to be trained, which is a collection of government affairs information to be trained published on government service platforms in different provinces and cities.
[0041] The training unit is used to input the set of government affairs information to be trained into the convolutional neural network model for pairing training to obtain the target government affairs pairing model;
[0042] The acquisition unit is used to acquire information about government affairs items to be linked.
[0043] The generation unit is used to generate a set of candidate government affairs entities from the knowledge base, wherein the set of candidate government affairs entities is a collection of candidate government affairs entities from different provinces and cities;
[0044] The first vector transformation unit is used to input all candidate government affairs entities in the candidate government affairs entity set into the sentence-transformer pre-trained model for vector transformation to obtain a first vector set, which is the set of the first vectors of all candidate government affairs entities;
[0045] The second vector transformation unit is used to input the government affairs information to be linked into the sentence-transformer pre-trained model for vector transformation to obtain the second vector.
[0046] A pairing unit is used to input the second vector and any first vector from the first vector set into the target government affairs pairing model for pairing.
[0047] The determining unit is used to determine the target government matter entity based on the output of the target government matter matching model;
[0048] The linking unit is used to link the government affairs information to be linked with the target government affairs entity.
[0049] Optionally, the training unit is specifically used for:
[0050] The training information is paired and labeled with information from different provinces and cities that points to the same government matter, and information from different provinces and cities that does not point to the same government matter. The training information includes the matter name, the name of the application materials, and the legal basis information.
[0051] Extract keyword features from the item names in the government affairs information to be trained;
[0052] The keyword features, application material names, and legal basis information in the government affairs information to be trained are respectively input into the sentence-transformer pre-training model for vector transformation to obtain a third vector set. The third vector set is the set of third vectors corresponding to the keyword features, application material names, and legal basis information in the government affairs information to be trained.
[0053] Using the paired labels as supervision labels, all third vectors in the third vector set are concatenated and input into the convolutional neural network model for iterative training.
[0054] When the convolutional neural network model converges, it is determined that the convolutional neural network model is a target government affairs matching model.
[0055] Optionally, the training unit is specifically used for:
[0056] The training information is paired and labeled with information from different provinces and cities that points to the same government matter, and information from different provinces and cities that does not point to the same government matter. The training information includes the matter name, the name of the application materials, and the legal basis information.
[0057] The jieba tool is used to segment the name of the matter in the government affairs information to be trained to obtain an independent word entity set, which is the set of all independent word entities in the matter name;
[0058] Using all the item names in the set of government affairs information to be trained as the corpus, weights are assigned to each independent word entity in the set of independent word entities.
[0059] Calculate the TF-IDF value for each independent word entity based on the weights.
[0060] Independent word entities whose TF-IDF values meet the first preset requirements are identified as keyword features;
[0061] The keyword features, application material names, and legal basis information in the government affairs information to be trained are respectively input into the sentence-transformer pre-training model for vector transformation to obtain a third vector set. The third vector set is the set of third vectors corresponding to the keyword features, application material names, and legal basis information in the government affairs information to be trained.
[0062] Using the paired labels as supervision labels, all third vectors in the third vector set are concatenated and input into the convolutional neural network model for iterative training.
[0063] When the convolutional neural network model converges, it is determined that the convolutional neural network model is a target government affairs matching model.
[0064] Optionally, the generation unit is specifically used for:
[0065] All candidate government affairs information in the knowledge base is categorized by province and city.
[0066] The information on government affairs to be linked is matched with the information on candidate government affairs from different provinces and cities by name;
[0067] The candidate government affairs information with the same name as the government affairs information to be linked is identified as the first candidate government affairs entity;
[0068] Calculate the LevenshteinDistance edit distance between the government affairs information to be linked and the non-first candidate government affairs entities;
[0069] Entities that are not the first candidate government affairs items and whose calculation results meet the second preset requirements are identified as second candidate government affairs items.
[0070] The set of the first candidate government affairs entities and the second candidate government affairs entities is defined as the candidate government affairs entity set.
[0071] Optionally, the first vector transformation unit is specifically used for:
[0072] Obtain the keyword features of the item names, application material names, and legal basis information of all candidate government affairs entities in the candidate government affairs entity set;
[0073] The keyword features of the item names, application material names, and legal basis information of all candidate government affairs entities are input into the sentence-transformer pre-trained model for vector transformation to obtain a first vector set. The first vector set is the set of first vectors corresponding to the keyword features, application material names, and legal basis information of the item names of all candidate government affairs entities.
[0074] Optionally, the second vector transformation vector is specifically used for:
[0075] Obtain the keyword characteristics of the name of the government affairs information to be linked, the name of the application materials, and the legal basis information;
[0076] The keyword features of the name of the government affairs information to be linked, the name of the application materials, and the legal basis information are input into the sentence-transformer pre-trained model for vector transformation to obtain the second vector.
[0077] A third aspect of this application provides a system for linking entities related to government affairs, including:
[0078] Central processing unit, memory, input / output interfaces, wired or wireless network interfaces, and power supply;
[0079] The memory is either a short-term storage memory or a persistent storage memory;
[0080] The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform any of the first aspect and any of the alternative methods of the first aspect.
[0081] A fourth aspect of this application provides a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform any of the methods described in the first aspect and its alternatives.
[0082] As can be seen from the above technical solutions, this application has the following effects:
[0083] The process involves: collecting a set of government service information to be trained, which is a collection of government service information published on government service platforms in different provinces and cities; inputting the set of government service information to be trained into a convolutional neural network model for pairing training to obtain a target government service pairing model; acquiring government service information to be linked; generating a set of candidate government service entities from a knowledge base, which is a collection of candidate government service entities from different provinces and cities; inputting all candidate government service entities from the candidate government service entity set into a sentence-transformer pre-training model for vector transformation to obtain a first vector set, which is a collection of the first vectors of all candidate government service entities; inputting the government service information to be linked into the sentence-transformer pre-training model for vector transformation to obtain a second vector; inputting the second vector and any first vector from the first vector set into the target government service pairing model for pairing; determining the target government service entity based on the output of the target government service pairing model; and linking the government service information to be linked with the target government service entity. In this way, the text in the candidate government affairs entities and the government affairs information to be linked can be transformed into a first vector and a second vector by the pre-trained sentence-transformer model. The first vector and the second vector contain the semantic information hidden in the text. Then, the first vector and the second vector are input into the target government affairs pairing model. The candidate government affairs entities that are successfully paired with the government affairs information to be linked are selected from the output of the target government affairs pairing model as the target government affairs entities. This reduces the situation where government affairs with different names but the same semantics cannot be linked, thereby improving the accuracy of entity linking of government affairs. Attached Figure Description
[0084] Figure 1 This is a schematic diagram of an embodiment of the entity linking method for government affairs in this application;
[0085] Figure 2-1 , Figure 2-2 as well as Figure 2-3 This is a schematic diagram of another embodiment of the entity linking method for government affairs in this application;
[0086] Figure 3 This is a schematic diagram of one embodiment of the entity linking device for government affairs in this application;
[0087] Figure 4 This is a schematic diagram of another embodiment of the entity linking device for government affairs in this application;
[0088] Figure 5 This is a schematic diagram of an embodiment of the entity linking system for government affairs in this application. Detailed Implementation
[0089] This application provides a method, apparatus, system, and storage medium for linking entities of government affairs, which improves the accuracy of linking entities of government affairs.
[0090] The entity linking method for government affairs described in this application is applied to government service platforms in different provinces and cities to link government affairs that are published on different government service platforms but actually point to the same matter.
[0091] The entity linking method for government affairs described in this application is applied to the implementation of the system.
[0092] Please see Figure 1 As shown, one embodiment of the entity linking method for government affairs in this application includes:
[0093] 101. Collect a set of government affairs information to be trained. This set of government affairs information to be trained is a collection of government affairs information to be trained published on government service platforms in different provinces and cities.
[0094] In this embodiment, the system collects information on government affairs items to be trained published on government service platforms in different provinces and cities, and uses the collection of multiple government affairs items to be trained as training samples for the model. For example, the government affairs items to be trained included in the collection are: "Teacher Qualification Certificate Processing" published on the government service platform of province A, "Motor Vehicle Registration" published on the government service platform of province B, and "Temporary Pass and License Issuance" published on the government service platform of province C.
[0095] 102. Input the set of government affairs information to be trained into the convolutional neural network model for pairing training to obtain the target government affairs pairing model;
[0096] The system uses the collected set of government affairs information to be trained as training samples to input into the convolutional neural network model for pairing training of government affairs. When the convolutional neural network model converges, it is determined that the convolutional neural network model is the target government affairs pairing model. The target government affairs pairing model is used to determine whether the two input government affairs point to the same thing. If they do, it means that the two input government affairs are successfully paired and entity linking can be performed; if not, it means that the two input government affairs are not successfully paired and entity linking cannot be performed.
[0097] 103. Obtain information on government service items to be linked;
[0098] In this embodiment, the government affairs information to be linked by the system is the government affairs that have been newly published on the government service platform or have not been physically linked to government affairs on other provincial or municipal government service platforms.
[0099] 104. Generate a set of candidate government affairs entities from the knowledge base. This set of candidate government affairs entities is a collection of candidate government affairs entities from different provinces and cities.
[0100] In this embodiment, a small set of candidate government affairs entities is generated from all government affairs entities in the knowledge base, which is most likely to contain the target government affairs entity. The number of candidate government affairs entities in this set is much smaller than the total number of government affairs entities in the knowledge base. For example, if the knowledge base contains 500 government affairs entities from different provinces and cities, and government affairs entities A, B, and C are three government affairs entities with a high probability of being successfully matched with the government affairs information to be linked, then the system determines the set of these three government affairs entities as the candidate government affairs entity set.
[0101] 105. Input all candidate government affairs entities in the candidate government affairs entity set into the sentence-transformer pre-trained model for vector transformation to obtain the first vector set, which is the set of the first vectors of all candidate government affairs entities;
[0102] In this embodiment, sentence-transformer, a Python framework, is used for sentence and text embedding. It can perform downstream tasks such as calculating sentence similarity, text similarity, semantic search, and paraphrasing. Since the names or related attribute information in candidate government affairs entities are all sentences and text, a pre-trained model based on the sentence-transformer framework can be used to transform the sentences and text in the input candidate government affairs entities into semantic vectors, thereby mining the semantic information hidden in the sentences and text of the candidate government affairs entities.
[0103] 106. Input the information of the government affairs to be linked into the sentence-transformer pre-trained model for vector transformation to obtain the second vector;
[0104] The names or related attributes in the government affairs information to be linked are also sentences and text. A pre-trained model based on the sentence-transformer framework can be used to transform the sentences and text in the input government affairs information to be linked into semantic vectors, so as to mine the semantic information hidden in the sentences and text in the government affairs information to be linked.
[0105] 107. Input the second vector and any first vector from the first vector set into the target government affairs matching model for matching;
[0106] In this embodiment, the second vector and any first vector from the first vector set are input together into the target government affairs matching model for pairing. This is to determine whether there is a first vector in the first vector set that is paired with the second vector. For example, if the first vector set contains first vector A, first vector B, and first vector C, during the judgment process of the target government affairs matching model, first vector A and first vector B are input together into the target government affairs matching model first, then first vector B and first vector C are input together into the target government affairs matching model, and finally first vector C and first vector C are input together into the target government affairs matching model.
[0107] 108. Determine the entity of the target government matter based on the output of the target government matter matching model;
[0108] The target government affairs entity is selected from the output of the target government affairs matching model. The target government affairs entity may contain one or more candidate government affairs entities. The specifics are not limited here.
[0109] 109. Link the information of the government affairs to be linked to the target government affairs entity.
[0110] Since the number of the target government affairs entity can be one or more, the government affairs information to be linked can be linked to one target government affairs entity or simultaneously linked to multiple government affairs entities.
[0111] In this embodiment, the text in the candidate government affairs entity and the government affairs information to be linked can be transformed into a first vector and a second vector by the sentence-transformer pre-trained model. The first vector and the second vector contain the semantic information hidden in the text. Then, the first vector and the second vector are input into the target government affairs pairing model. The candidate government affairs entity that is successfully paired with the government affairs information to be linked is selected from the output of the target government affairs pairing model as the target government affairs entity. This reduces the situation where government affairs with different names but the same semantics cannot be linked, thereby improving the accuracy of entity linking of government affairs.
[0112] Please see Figure 2-1 , Figure 2-2 as well as Figure 2-3 As shown, another embodiment of the entity linking method for government affairs in this application includes:
[0113] 201. Collect a set of government affairs information to be trained. This set of government affairs information to be trained is a collection of government affairs information to be trained published on government service platforms in different provinces and cities.
[0114] Step 201 in this implementation is the same as described above. Figure 1 Step 101 in the illustrated embodiment is similar and will not be described again here.
[0115] 202. Pair and label the training information for government affairs that originate from different provinces and cities but point to the same government affairs, and the training information for government affairs that originate from different provinces and cities but do not point to the same government affairs. The training information includes the name of the matter, the name of the application materials, and the legal basis information.
[0116] 203. Use the jieba tool to segment the names of government affairs information to be trained, and obtain a set of independent word entities. The set of independent word entities is the collection of all independent word entities in the name of the matter.
[0117] 204. Using all the item names in the set of government affairs information to be trained as the corpus, assign weights to each independent word entity in the set of independent word entities;
[0118] 205. Calculate the TF-IDF value for each independent word entity based on its weight;
[0119] 206. Determine the independent word entities whose TF-IDF values meet the first preset requirements as keyword features;
[0120] 207. Input the keyword features, application material names, and legal basis information in the government affairs information to be trained into the sentence-transformer pre-training model for vector transformation to obtain a third vector set. The third vector set is the set of third vectors corresponding to the keyword features, application material names, and legal basis information in the government affairs information to be trained.
[0121] 208. Using paired labels as supervision labels, concatenate all third vectors in the third vector set and input them into the convolutional neural network model for iterative training;
[0122] 209. When the convolutional neural network model converges, determine the convolutional neural network model as the target government affairs matching model;
[0123] Optionally, in this embodiment, all pairs of government affairs information in the training information set that originate from different provinces and cities but point to the same government affairs matter are paired and labeled, such as labeled as "pairing successful"; all pairs of government affairs information in the training information set that originate from different provinces and cities but do not point to the same government affairs matter are paired and labeled, such as labeled as "pairing failed". For example, if the training information set contains three government affairs information items A, B, and C, all originating from different provinces and cities, and A and B point to the same government affairs matter, then A and B are labeled as "pairing successful"; if A and C point to the same government affairs matter, then A and C are labeled as "pairing successful"; if C and B do not point to the same government affairs matter, then C and B are labeled as "pairing failed". The training information for government affairs matters may include the matter name, the application material name, and the legal basis information, such as: the matter name is "Teacher Qualification Certificate Recognition", the application material name is "Application for Teacher Qualification Certificate for Zhang San", and the legal basis information is "based on laws A, B, and C".
[0124] Jieba is a word segmentation tool used to segment the names of government affairs information to be trained. For example, if the name of the matter is "Teacher Qualification Certificate Certification", the segmented result will be word entities such as "teacher", "qualification certificate", and "certification". After word segmentation, the Term Frequency-Inverse Document Frequency (TF-IDF) algorithm can be used to extract keywords from the obtained word entities. First, all the names of the government affairs information set to be trained are used as the corpus. Then, each word entity is assigned a corresponding weight according to its frequency of occurrence in the entire corpus, and the TF-IDF value of each word entity is calculated based on the weight. Finally, the word entities with the highest TF-IDF values are selected as keyword features.
[0125] The keyword features, application material names, and legal basis information from the government affairs information to be trained are input into a sentence-transformer pre-training model for vector transformation to obtain third vectors corresponding to the keyword features, application material names, and legal basis information. These three third vectors are then concatenated and input into a convolutional neural network model for training. The pairing labels of the government affairs information to be trained are used as supervision labels. When the convolutional neural network model meets the convergence requirements, it is designated as the target government affairs pairing model and saved for subsequent pairing judgments of government affairs information to be linked. In this way, a target government affairs pairing model with high pairing accuracy can be trained, thereby improving the linking accuracy of government affairs entities.
[0126] 210. Obtain information on government affairs items to be linked;
[0127] Step 210 in this embodiment is the same as described above. Figure 1 Step 103 in the illustrated embodiment is similar and will not be described again here.
[0128] 211. Classify all candidate government affairs information in the knowledge base by province and city;
[0129] 212. Match the names of the government affairs information to be linked with the candidate government affairs information of different provinces and cities;
[0130] 213. Identify the candidate government affairs information with the same name as the information to be linked as the first candidate government affairs entity;
[0131] 214. Calculate the LevenshteinDistance edit distance between the government affairs information to be linked and the non-first candidate government affairs entities;
[0132] 215. Entities that are not the first candidate government affairs items and whose calculation results meet the second preset requirements are identified as the second candidate government affairs items.
[0133] 216. The set of the first candidate government affairs entities and the second candidate government affairs entities is determined as the candidate government affairs entity set, which is a set of candidate government affairs entities from different provinces and cities;
[0134] Optionally, in this embodiment, all candidate government affairs information in the knowledge base can be categorized according to their respective provinces and cities. For example, if candidate government affairs A and B in the knowledge base are published on the government service platform of province A, and candidate government affairs C and D are published on the government service platform of province B, then the knowledge base can be divided into two major categories: province A and province B. The province A category contains candidate government affairs A and B, and the province B category contains candidate government affairs C and D. The candidate government affairs information from each province and city after categorization is matched one by one with the government affairs information to be linked, and the candidate government affairs information with the same name is selected as the first candidate government affairs entity. For candidate government affairs information in the knowledge base that is not selected as the first candidate government affairs entity, the Levenshtein Distance edit distance can be calculated one by one between this part of the candidate government affairs information and the government affairs information to be linked, and the candidate government affairs information ranked higher in the calculation results can be selected as the second government affairs entity. Levenshtein Distance refers to the minimum number of edit operations required to transform one string into the other. The edit distance algorithm can be used to calculate the edit distance between two government affairs items. By employing a candidate-first, then precise recall approach, the sequential comparison of all attributes across all data can be reduced, thereby improving the efficiency of confirming the target government affairs entity.
[0135] 217. Obtain the keyword characteristics of the item names, application material names, and legal basis information of all candidate government affairs entities in the candidate government affairs entity set;
[0136] 218. Input the keyword features of the item names, application material names, and legal basis information of all candidate government affairs entities into the sentence-transformer pre-trained model for vector transformation to obtain the first vector set. The first vector set is the set of first vectors corresponding to the keyword features, application material names, and legal basis information of the item names of all candidate government affairs entities. This first vector set is the set of first vectors of all candidate government affairs entities.
[0137] 219. Obtain the keyword characteristics of the name of the government affairs information to be linked, the name of the application materials, and the legal basis information;
[0138] 220. Input the keyword features of the name of the government affairs information to be linked, the name of the application materials, and the legal basis information into the sentence-transformer pre-trained model for vector transformation to obtain the second vector;
[0139] Optionally, in this embodiment, the keyword features of the item name, the name of the application materials, and the legal basis information of the candidate government affairs item entity can be input into the sentence-transformer pre-trained model for vector transformation, and the first vectors corresponding to the keyword features, the name of the application materials, and the legal basis information can be concatenated. The concatenated first vector is used as the input of the target government affairs item pairing model. The method for extracting the keyword features of the candidate government affairs item entity is the same as the method described in the previous embodiment.
[0140] The keyword features of the item name, the name of the application materials, and the legal basis information from the government service item information to be linked can be input into the sentence-transformer pre-trained model for vector transformation. The second vectors corresponding to the keyword features, application material names, and legal basis information are then concatenated. This concatenated second vector is used as the input to the target government service item pairing model. The method for extracting the keyword features of the government service item information to be linked is consistent with the method described in the previous embodiment. This improves the accuracy of the input features of the target government service item pairing model, thereby enhancing the pairing accuracy of the model.
[0141] 221. Input the second vector and any first vector from the first vector set into the target government affairs matching model for matching;
[0142] 222. Determine the entity of the target government matter based on the output of the target government matter matching model;
[0143] 223. Link the information of the government affairs to be linked to the target government affairs entity.
[0144] Steps 221 to 223 in this embodiment are the same as those described above. Figure 1 Steps 107 to 109 in the illustrated embodiment are similar and will not be described again here.
[0145] Please see Figure 3 As shown, one embodiment of the entity linking device for government affairs in this application includes:
[0146] The data collection unit 301 is used to collect a set of government affairs information to be trained, which is a collection of government affairs information to be trained published on government service platforms in different provinces and cities.
[0147] Training unit 302 is used to input the set of government affairs information to be trained into the convolutional neural network model for pairing training to obtain the target government affairs pairing model;
[0148] Acquisition unit 303 is used to acquire information on government affairs items to be linked;
[0149] The generation unit 304 is used to generate a set of candidate government affairs entities to be linked from the knowledge base. The set of candidate government affairs entities is a collection of candidate government affairs entities from different provinces and cities.
[0150] The first vector transformation unit 305 is used to input all candidate government affairs entities in the candidate government affairs entity set into the sentence-transformer pre-trained model for vector transformation to obtain a first vector set, which is the set of the first vectors of all candidate government affairs entities;
[0151] The second vector transformation unit 306 is used to input the government affairs information to be linked into the sentence-transformer pre-trained model for vector transformation to obtain the second vector.
[0152] The pairing unit 307 is used to input the second vector and any first vector from the first vector set into the target government affairs pairing model for pairing.
[0153] Determining unit 308 is used to determine the entity of the target government matter based on the output of the target government matter pairing model;
[0154] Linking unit 309 is used to link the government affairs information to be linked with the target government affairs entity.
[0155] In this embodiment, the acquisition unit 301 acquires a set of government affairs information to be trained, which is a collection of government affairs information published on government service platforms of different provinces and cities; the training unit 302 inputs the set of government affairs information to be trained into a convolutional neural network model for pairing training to obtain a target government affairs pairing model; the acquisition unit 303 acquires government affairs information to be linked; the generation unit 304 generates a set of candidate government affairs entities for the government affairs information to be linked from the knowledge base, which is a collection of candidate government affairs entities from different provinces and cities; the first vector conversion unit 305 inputs all candidate government affairs entities in the candidate government affairs entity set into the sent... The first vector set is obtained by performing vector transformation in the sentence-transformer pre-training model. This first vector set is the set of first vectors of all candidate government affairs entities. The second vector transformation unit 306 inputs the government affairs information to be linked into the sentence-transformer pre-training model for vector transformation to obtain the second vector. The pairing unit 307 inputs the second vector and any first vector in the first vector set into the target government affairs pairing model for pairing. The determination unit 308 determines the target government affairs entity based on the output of the target government affairs pairing model. The linking unit 309 links the government affairs information to be linked with the target government affairs entity. In this way, the text in the candidate government affairs entities and the government affairs information to be linked can be transformed into a first vector and a second vector by the pre-trained sentence-transformer model. The first vector and the second vector contain the semantic information hidden in the text. Then, the first vector and the second vector are input into the target government affairs pairing model. The candidate government affairs entities that are successfully paired with the government affairs information to be linked are selected from the output of the target government affairs pairing model as the target government affairs entities. This reduces the situation where government affairs with different names but the same semantics cannot be linked, thereby improving the accuracy of entity linking of government affairs.
[0156] Please see Figure 4 As shown, another embodiment of the entity linking device for government affairs in this application includes:
[0157] The data collection unit 401 is used to collect the information set of government affairs items to be trained, which is a collection of government affairs items to be trained published on government service platforms in different provinces and cities;
[0158] Training unit 402 is specifically used to pair and label training government affairs information from different provinces and cities that point to the same government affairs, as well as training government affairs information from different provinces and cities that do not point to the same government affairs. The training government affairs information includes the affairs name, application material name, and legal basis information. The jieba tool is used to segment the affairs names in the training government affairs information to obtain an independent word entity set, which is the set of all independent word entities in the affairs name. Using all affairs names in the training government affairs information set as a corpus, weights are assigned to each independent word entity in the independent word entity set. Based on the weights, a pair of independent word entities is calculated. The corresponding TF-IDF value is determined; independent word entities whose TF-IDF values meet the first preset requirement are identified as keyword features; the keyword features, application material names, and legal basis information in the government affairs information to be trained are respectively input into the sentence-transformer pre-training model for vector transformation to obtain a third vector set, which is the set of third vectors corresponding to the keyword features, application material names, and legal basis information in the government affairs information to be trained; using pairing labels as supervision labels, all third vectors in the third vector set are concatenated and input into the convolutional neural network model for iterative training; when the convolutional neural network model converges, the convolutional neural network model is determined as the target government affairs pairing model;
[0159] Unit 403 is used to obtain information on government affairs items to be linked.
[0160] The generation unit 404 is specifically used to classify all candidate government affairs information in the knowledge base by province and city; match the name of the government affairs information to be linked with the candidate government affairs information in different provinces and cities; determine the candidate government affairs information with the same name as the government affairs information to be linked as the first candidate government affairs entity; calculate the Levenshtein Distance edit distance between the government affairs information to be linked and the non-first candidate government affairs entity; determine the non-first candidate government affairs entity whose calculation result meets the second preset requirement as the second candidate government affairs entity; and determine the set of the first candidate government affairs entity and the second candidate government affairs entity as the candidate government affairs entity set.
[0161] The first vector transformation unit 405 is specifically used to obtain the keyword features, application material names, and legal basis information of the names of all candidate government affairs entities in the candidate government affairs entity set; input the keyword features, application material names, and legal basis information of the names of all candidate government affairs entities into the sentence-transformer pre-trained model for vector transformation to obtain the first vector set. The first vector set is the set of first vectors corresponding to the keyword features, application material names, and legal basis information of the names of all candidate government affairs entities.
[0162] The second vector transformation unit 406 is specifically used to obtain the keyword features, application material names, and legal basis information of the name of the government affairs information to be linked; and input the keyword features, application material names, and legal basis information of the name of the government affairs information to be linked into the sentence-transformer pre-trained model for vector transformation to obtain the second vector.
[0163] The pairing unit 407 is used to input the second vector and any first vector from the first vector set into the target government affairs pairing model for pairing.
[0164] The determining unit 408 is used to determine the entity of the target government matter based on the output of the target government matter pairing model.
[0165] Linking unit 409 is used to link the government affairs information to be linked with the target government affairs entity.
[0166] In this embodiment, the functions of each unit are the same as those described above. Figure 2-1 , Figure 2-2 as well as Figure 2-3 The functions of steps 201 to 223 in the illustrated embodiment are similar and will not be described again here.
[0167] Please see Figure 5 As shown, one embodiment of the entity linking system for government affairs in this application includes:
[0168] Central processing unit 502, memory 501, input / output interface 503, wired or wireless network interface 504, and power supply 505;
[0169] Memory 501 is either a short-term storage memory or a persistent storage memory;
[0170] The central processing unit 502 is configured to communicate with the memory 501 and execute instructions stored in the memory 501 to perform the aforementioned operations. Figure 1 The steps in the embodiment shown in Figure 2 are as follows.
[0171] This application provides a computer-readable storage medium, including instructions that, when executed on a computer, cause the computer to perform the aforementioned... Figure 1 The steps in the embodiment shown in Figure 2 are as follows.
[0172] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0173] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of 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 coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0174] 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.
[0175] Furthermore, the functional units in the various embodiments of this application 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.
[0176] 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 technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for linking entities in government affairs, characterized in that, include: Collect a set of government affairs information to be trained, which is a collection of government affairs information to be trained published on government service platforms in different provinces and cities; The set of government affairs information to be trained is input into a convolutional neural network model for pairing training to obtain a target government affairs pairing model. Obtain information on government affairs items to be linked; Generate a candidate set of government affairs entities from the knowledge base, wherein the candidate set of government affairs entities is a collection of candidate government affairs entities from different provinces and cities; Generating a candidate set of government affairs entities from the knowledge base includes: classifying all candidate government affairs information in the knowledge base by province and city; matching the name of the government affairs information to be linked with the candidate government affairs information in different provinces and cities; identifying candidate government affairs entities with the same name as the government affairs information to be linked as first candidate government affairs entities; calculating the LevenshteinDistance edit distance between the government affairs information to be linked and non-first candidate government affairs entities; identifying non-first candidate government affairs entities whose calculation results meet a second preset requirement as second candidate government affairs entities; and determining the set of first and second candidate government affairs entities as the candidate government affairs entity set. All candidate government affairs entities in the candidate government affairs entity set are input into the sentence-transformer pre-trained model for vector transformation to obtain a first vector set, which is the set of the first vectors of all candidate government affairs entities; The information of the government affairs to be linked is input into the sentence-transformer pre-trained model for vector transformation to obtain the second vector; The second vector and any first vector from the first vector set are input into the target government affairs matching model for matching; The target government item entity is determined based on the output of the target government item matching model. Link the information of the government affairs to be linked to the entity of the target government affairs.
2. The entity linking method for government affairs as described in claim 1, characterized in that, The step of inputting the set of government affairs information to be trained into a convolutional neural network model for pairing training to obtain the target government affairs pairing model includes: The training information is paired and labeled with information from different provinces and cities that points to the same government matter, and information from different provinces and cities that does not point to the same government matter. The training information includes the matter name, the name of the application materials, and the legal basis information. Extract keyword features from the item names in the government affairs information to be trained; The keyword features, application material names, and legal basis information in the government affairs information to be trained are respectively input into the sentence-transformer pre-training model for vector transformation to obtain a third vector set. The third vector set is the set of third vectors corresponding to the keyword features, application material names, and legal basis information in the government affairs information to be trained. Using the paired labels as supervision labels, all third vectors in the third vector set are concatenated and input into the convolutional neural network model for iterative training. When the convolutional neural network model converges, it is determined that the convolutional neural network model is a target government affairs matching model.
3. The entity linking method for government affairs as described in claim 2, characterized in that, The extraction of keyword features from the item names in the government affairs item information to be trained includes: The jieba tool is used to segment the name of the matter in the government affairs information to be trained to obtain an independent word entity set, which is the set of all independent word entities in the matter name; Using all the item names in the set of government affairs information to be trained as the corpus, weights are assigned to each independent word entity in the set of independent word entities. Calculate the TF-IDF value for each independent word entity based on the weights. Independent word entities whose TF-IDF values meet the first preset requirements are identified as keyword features.
4. The entity linking method for government affairs according to any one of claims 1 to 3, characterized in that, The step of inputting all candidate government affairs entities from the candidate government affairs entity set into the sentence-transformer pre-trained model for vector transformation to obtain the first vector set includes: Obtain the keyword features of the item names, application material names, and legal basis information of all candidate government affairs entities in the candidate government affairs entity set; The keyword features of the item names, application material names, and legal basis information of all candidate government affairs entities are input into the sentence-transformer pre-trained model for vector transformation to obtain a first vector set. The first vector set is the set of first vectors corresponding to the keyword features, application material names, and legal basis information of the item names of all candidate government affairs entities.
5. The entity linking method for government affairs according to any one of claims 1 to 3, characterized in that, The step of inputting the information of the government affairs to be linked into the sentence-transformer pre-trained model for vector transformation to obtain the second vector includes: Obtain the keyword characteristics of the name of the government affairs information to be linked, the name of the application materials, and the legal basis information; The keyword features of the name of the government affairs information to be linked, the name of the application materials, and the legal basis information are input into the sentence-transformer pre-trained model for vector transformation to obtain the second vector.
6. A physical linking device for government affairs, characterized in that, include: The data collection unit is used to collect a set of government affairs information to be trained, which is a collection of government affairs information to be trained published on government service platforms in different provinces and cities. The training unit is used to input the set of government affairs information to be trained into the convolutional neural network model for pairing training to obtain the target government affairs pairing model; The acquisition unit is used to acquire information about government affairs items to be linked. The generation unit is used to generate a set of candidate government affairs entities from the knowledge base, wherein the set of candidate government affairs entities is a collection of candidate government affairs entities from different provinces and cities; The generation unit specifically includes: classifying all candidate government affairs information in the knowledge base by province and city; matching the name of the government affairs information to be linked with the candidate government affairs information in different provinces and cities; determining the candidate government affairs information with the same name as the government affairs information to be linked as the first candidate government affairs entity; calculating the LevenshteinDistance edit distance between the government affairs information to be linked and the non-first candidate government affairs entity; determining the non-first candidate government affairs entity whose calculation result meets the second preset requirement as the second candidate government affairs entity; and determining the set of the first candidate government affairs entity and the second candidate government affairs entity as the candidate government affairs entity set. The first vector transformation unit is used to input all candidate government affairs entities in the candidate government affairs entity set into the sentence-transformer pre-trained model for vector transformation to obtain a first vector set, which is the set of the first vectors of all candidate government affairs entities; The second vector transformation unit is used to input the government affairs information to be linked into the sentence-transformer pre-trained model for vector transformation to obtain the second vector. A pairing unit is used to input the second vector and any first vector from the first vector set into the target government affairs pairing model for pairing. The determining unit is used to determine the target government matter entity based on the output of the target government matter matching model; The linking unit is used to link the government affairs information to be linked with the target government affairs entity.
7. The entity linking device for government affairs as described in claim 6, characterized in that, The training unit is specifically used for: The training information is paired and labeled with information from different provinces and cities that points to the same government matter, and information from different provinces and cities that does not point to the same government matter. The training information includes the matter name, the name of the application materials, and the legal basis information. Extract keyword features from the item names in the government affairs information to be trained; The keyword features, application material names, and legal basis information in the government affairs information to be trained are respectively input into the sentence-transformer pre-training model for vector transformation to obtain a third vector set. The third vector set is the set of third vectors corresponding to the keyword features, application material names, and legal basis information in the government affairs information to be trained. Using the paired labels as supervision labels, all third vectors in the third vector set are concatenated and input into the convolutional neural network model for iterative training. When the convolutional neural network model converges, it is determined that the convolutional neural network model is a target government affairs matching model.
8. A system for linking entities in government affairs, characterized in that, include: Central processing unit, memory, input / output interfaces, wired or wireless network interfaces, and power supply; The memory is either a short-term storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method according to any one of claims 1 to 5.
9. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Government affair related data sorting method, device and equipment and readable storage medium
CN115098596A
Entity linking method and device, storage medium and electronic equipment
CN115129883A