A method, device and system for matching regulations in a regulation library

By obtaining the text vector of the query statement input by the user, combining classification similarity, semantic similarity and label similarity, comprehensive sorting regulations, the problem of low accuracy in the existing regulatory database and regulatory matching methods is solved, and more accurate regulatory return is achieved.

CN115858731BActive Publication Date: 2025-08-05BEIJING UFIDA GOVERNMENT AFFAIRS SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211653939.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-22
Publication Date
2025-08-05
Estimated Expiration
2042-12-22

AI Technical Summary

Technical Problem

In the existing regulatory database, the matching accuracy is low and the user's desired regulations cannot be accurately returned.

Method used

By obtaining the text vector of the query statement input by the user, determine the regulatory library type and calculate the classification similarity, semantic similarity and matching similarity, combined with the label similarity, comprehensive sorting regulations to improve matching accuracy.

Benefits of technology

This greatly improves the accuracy of regulations matching and ensures that the returned regulations meet user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115858731B_ABST
    Figure CN115858731B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device and system for matching regulations in a regulation library, belonging to the field of regulation matching. After obtaining the text vector of the query statement input by the user, the corresponding regulation library type of the query statement is determined according to the text vector, so as to match regulations in the corresponding regulation library, greatly reducing the amount of calculation. Then, a first regulation list is obtained according to the semantic vector in the regulation library, further reducing the amount of calculation for calculating the matching similarity subsequently. After that, the matching score of the first regulation is calculated according to the classification similarity, semantic similarity and matching similarity, and the first regulation is comprehensively sorted from three dimensions of regulation library classification, semantic vector and regulation matching, so that the final sorting result is accurate, unnecessary regulations are excluded, meeting the user's needs, and greatly improving the accuracy of regulation matching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of regulation matching, and particularly to a method, device and system for matching regulations in a regulation library. Background Art

[0002] A regulation library is a database that stores various current regulatory legal documents and other regulations. After a user inputs a query statement, existing laws and regulations can be queried in the regulation library. Currently, the main method for matching regulations for a query statement is to match the user's keywords with an index database and feedback the regulations with a relatively high match to the user. However, the method of matching by keywords is likely to return irrelevant regulations to the user. Therefore, the existing method for matching regulations in a regulation library has a low matching accuracy and cannot accurately return the regulations desired by the user. Summary of the Invention

[0003] In order to overcome the deficiencies of the prior art, the present invention provides a method, device and system for matching regulations in a regulation library to solve the problem that the existing method for matching regulations in a regulation library has a low matching accuracy and cannot accurately return the regulations desired by the user.

[0004] The technical solution adopted by the present invention to solve its technical problems is as follows:

[0005] In a first aspect, a method for matching regulations in a regulation library is provided, including the following steps:

[0006] Obtain the text vector of the query statement input by the user;

[0007] Determine the type of regulation library corresponding to the query statement and the classification similarity according to the text vector, where the classification similarity is used to represent the probability that the text vector belongs to the determined regulation library;

[0008] Calculate the semantic similarity between the text vector and the semantic vectors of all regulations in the determined regulation library, and sort the corresponding regulations in descending order according to the semantic similarity. Select the first N1 regulations as the first regulations according to the sorting of the semantic similarity, and obtain a first regulation list according to the first regulations; where N1 is a positive integer;

[0009] Input the text vector and the first regulation list into a pre-trained regulation recommendation model to obtain the matching similarity between each first regulation in the first regulation list and the query statement;

[0010] Calculate the matching scores of each first regulation in the first regulation list according to the classification similarity, the semantic similarity and the matching similarity, and sort the corresponding first regulations in descending order according to the matching scores;

[0011] Select the top N2 first regulations as the second regulations according to the ranking of the matching scores, where N2 is a positive integer and N2 is less than N1;

[0012] Return the second regulations to the user.

[0013] Furthermore, calculating the matching scores of each first regulation in the first regulation list according to the classification similarity, the semantic similarity, and the matching similarity includes:

[0014] Obtain the tag data of the query statement and the preset tag data corresponding to each first regulation in the first regulation list, where the tag data is used to represent the field to which the query statement belongs;

[0015] Input the tag data and each preset tag data into a pre-trained tag recommendation model to obtain the tag similarity of each first regulation in the first regulation list;

[0016] Calculate the matching scores of each first regulation in the first regulation list according to the classification similarity, the semantic similarity, the matching similarity, and the tag similarity.

[0017] Furthermore, the matching score calculation formula is: matching score = classification similarity * first preset weight + semantic similarity * second preset weight + matching similarity * third preset weight + tag similarity * fourth preset weight.

[0018] Furthermore, determining the type of regulation library corresponding to the query statement and the classification similarity according to the text vector includes:

[0019] Input the text vector into a pre-trained regulation classification model to obtain the probability value of the query statement matching any preset type of regulation library;

[0020] Take the regulation library with the largest probability value as the corresponding regulation library type, and take the probability value of the corresponding regulation library type as the classification similarity.

[0021] Furthermore, the regulation classification model is trained using multiple teacher models, and each teacher model corresponds to a type of regulation library; when training the regulation classification model:

[0022] Use part of the data of the teacher model to train multiple student models respectively to obtain multiple trained target student models;

[0023] For each target student model, calculate the similarity between the result output by the target student model and the result output by the teacher model;

[0024] Determine the weights of each target student model respectively according to each similarity;

[0025] Obtain the regulation classification model according to each target student model and each weight.

[0026] Furthermore, it further includes:

[0027] Obtain the total click count of any regulation in the regulation library within a preset period, and the total click count is the sum of the click counts of each user clicking on the regulation;

[0028] Sort the regulations in the regulation library in descending order according to the total click count;

[0029] Recommend the top N3 regulations to the user according to the sorting result of the total click count, where N3 is a positive integer.

[0030] Furthermore, it further includes:

[0031] Obtain the click weight of any user for any regulation in the regulation library, and the click weight is equal to the ratio of the first click count to the second click count. The first click count is the click count of the user clicking on any regulation, and the second click count is the click count of the regulation with the most clicks by the user;

[0032] For each regulation, add up the click weights of all users for the regulation to obtain the total click weight of the regulation;

[0033] Obtain the target total click weight of the regulation with the largest total click weight value, and obtain the relative weight of each regulation. The relative weight is the ratio of the total click weight of the regulation to the target total click weight;

[0034] If the relative weight of any regulation is less than the preset weight value, multiply the click weight of the regulation corresponding to each user by a preset coefficient to obtain the target weight of the regulation corresponding to the user, and the preset coefficient is greater than 1; if the relative weight of any regulation is greater than or equal to the preset weight value, divide the click weight of the regulation corresponding to each user by the target total click weight to obtain the target weight;

[0035] Sort the regulations clicked by the user in descending order according to the target weight;

[0036] Recommend the top N4 regulations to the user according to the sorting result of the target weight, where N4 is a positive integer.

[0037] Furthermore, it further includes:

[0038] Obtain the user's historical query statement and the historical text vector of the historical query statement;

[0039] When the user inputs the current query statement, use the BM25 algorithm to calculate the text similarity between the current query statement and any of the historical query statements, and calculate the vector similarity between the text vector of the current query statement and the historical text vector of any of the historical query statements;

[0040] According to the text similarity and the vector similarity, calculate the final similarity between the current query statement and each historical query statement, where the final similarity = historical similarity * the first preset coefficient + vector similarity * the second preset coefficient;

[0041] Sort the historical query statements in descending order according to the final similarity;

[0042] According to the sorting of the final similarity, select the first N5 historical query statements from the historical query statements and recommend them to the user, where N5 is a positive integer.

[0043] In a second aspect, a device for matching regulations in a regulation library is provided, including:

[0044] A text vector acquisition module for acquiring the text vector of the query statement input by the user;

[0045] A classification similarity acquisition module for determining the type of regulation library corresponding to the query statement and the classification similarity according to the text vector, where the classification similarity is used to represent the probability that the text vector belongs to the determined regulation library;

[0046] A semantic similarity acquisition module for calculating the semantic similarity between the text vector and the semantic vectors of all regulations in the determined regulation library, sorting the corresponding regulations in descending order according to the semantic similarity, selecting the first N1 regulations as the first regulations according to the sorting of the semantic similarity, and obtaining a first regulation list according to the first regulations; where N1 is a positive integer;

[0047] A matching similarity acquisition module for inputting the text vector and the first regulation list into a pre-trained regulation recommendation model to obtain the matching similarity between each first regulation in the first regulation list and the query statement;

[0048] A matching score acquisition module for calculating the matching scores of each first regulation in the first regulation list according to the classification similarity, the semantic similarity and the matching similarity, and sorting the corresponding first regulations in descending order according to the matching scores;

[0049] A second regulation acquisition module for selecting the first N2 first regulations as the second regulations according to the sorting of the matching scores, where N2 is a positive integer and N2 is less than N1;

[0050] A regulation return module for returning the second regulation to the user.

[0051] In a third aspect, a regulation matching system for a regulation library is provided, including:

[0052] A processor;

[0053] A memory for storing executable instructions of the processor;

[0054] The processor is configured to execute the method described in any one of the technical solutions provided in the first aspect.

[0055] Advantageous effects:

[0056] The technical solution of this application provides a regulation matching method, device and system for a regulation library. After obtaining the text vector of the query statement input by the user, the corresponding regulation library type of the query statement is determined according to the text vector, so as to match regulations in the corresponding regulation library, greatly reducing the amount of calculation. Then, a first regulation list is obtained according to the semantic vector in the regulation library, further reducing the amount of calculation for calculating the matching similarity subsequently. After that, the matching score of the first regulation is calculated according to the classification similarity, semantic similarity and matching similarity, and the first regulation is comprehensively sorted from three dimensions of regulation library classification, semantic vector and regulation matching, so that the final sorting result is accurate, excluding unnecessary regulations and meeting the user's needs, greatly improving the accuracy of regulation matching. Description of the Drawings

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0058] Figure 1 It is a flowchart of a regulation matching method for a regulation library provided by an embodiment of the present invention;

[0059] Figure 2 It is a flowchart of a specific regulation matching method for a regulation library provided by an embodiment of the present invention;

[0060] Figure 3 It is a schematic structural diagram of a regulation matching device for a regulation library provided by an embodiment of the present invention. Detailed Embodiments

[0061] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of the present invention will be described in detail below with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. All other implementation manners obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts belong to the scope protected by this application.

[0062] In the first embodiment, referring to Figure 1 , the embodiment of the present invention provides a method for matching regulations in a regulation library, including the following steps:

[0063] S11: Obtain the text vector of the query statement input by the user;

[0064] S12: Determine the type of regulation library corresponding to the query statement and the classification similarity according to the text vector. The classification similarity is used to represent the probability that the text vector belongs to the determined regulation library;

[0065] S13: Calculate the semantic similarity between the text vector and the semantic vectors of all regulations in the determined regulation library, and sort the corresponding regulations in descending order of semantic similarity. Select the first N1 regulations as the first regulations according to the sorting of semantic similarity, and obtain the first regulation list according to the first regulations; where N1 is a positive integer;

[0066] S14: Input the text vector and the first regulation list into a pre-trained regulation recommendation model to obtain the matching similarity between each first regulation in the first regulation list and the query statement;

[0067] S15: Calculate the matching scores of each first regulation in the first regulation list according to the classification similarity, semantic similarity, and matching similarity, and sort the corresponding first regulations in descending order of matching score;

[0068] S16: Select the first N2 first regulations as the second regulations according to the sorting of matching scores, where N2 is a positive integer and N2 is less than N1;

[0069] S17: Return the second regulations to the user.

[0070] In an embodiment of the present invention, a method for matching regulations in a regulation library. After obtaining the text vector of the query statement input by the user, the corresponding regulation library type of the query statement is determined according to the text vector, so as to match regulations in the corresponding regulation library, greatly reducing the amount of calculation. Then, a first regulation list is obtained from the regulation library according to the semantic vector, further reducing the amount of calculation for calculating the matching similarity in the subsequent process. After that, the matching score of the first regulation is calculated according to the classification similarity, semantic similarity, and matching similarity, and the first regulation is comprehensively sorted from three dimensions: regulation library classification, semantic vector, and regulation matching, so that the final sorting result is accurate, excluding unnecessary regulations, meeting the user's needs, and greatly improving the accuracy of regulation matching.

[0071] In the second embodiment, the present invention provides a specific method for matching regulations in a regulation library, as Figure 2 shown, including the following steps:

[0072] Obtain the text vector of the query statement input by the user; specifically, extract the text vector of the query statement by using any one or more of One-Hot, TF-IDF, or word2vec.

[0073] Determine the corresponding regulation library type of the query statement and the classification similarity according to the text vector, and the classification similarity is used to represent the probability that the text vector belongs to the determined regulation library; specifically, input the text vector into the pre-trained regulation classification model to obtain the probability value of the query statement matching any preset type of regulation library; take the regulation library with the largest probability value as the corresponding regulation library type, and take the probability value of the corresponding regulation library type as the classification similarity. Exemplarily, the regulation library types are divided into procurement-related regulations and finance-related regulations.

[0074] The regulation classification model is trained using multiple teacher models, each corresponding to a type of regulation library. During training, the regulation classification model uses partial data from the teacher model to train multiple student models, obtaining multiple trained target student models. For each target student model, the similarity between the output of the target student model and the output of the teacher model is calculated. Based on the similarities, the weights of the target student models are determined. Based on the target student models and their weights, the regulation classification model is obtained. A traditional teacher model is a large model that trains multiple small student models. However, this approach results in similar student models that are less effective when used with different regulation libraries. Furthermore, a traditional teacher model takes up too much space during training and places high demands on memory. When training with multiple teacher models, the heavier model is transformed into a lightweight, implementable model through network structure modification. Moreover, when training the student model, since only part of the data is used, the basic similarity of the final student model can be avoided. In this way, different target student models can be used to obtain different features. Since each target student model can obtain different features, such as the complete data originally contains three features A, B, and C (A, B, and C are vectors, which are convenient for calculation with subsequent weights), the features obtained by the trained target student model 1 are A and B, and the features obtained by the target student model 2 are B and C. The outputs of the corresponding target student models are weighted according to the weights of each target student model, and then the weighted identical features are summed to obtain the final classification result. This ensures that all features can be obtained and avoids the loss of important features.

[0075] Calculate the semantic similarity between the text vector and the semantic vectors of all regulations in the determined regulatory database, and sort the corresponding regulations in descending order of semantic similarity. Select the first N1 regulations based on the semantic similarity ranking as the first regulations, and obtain a first regulation list based on the first regulations; where N1 is a positive integer and is set according to actual needs; an exemplary N1 is 128. The semantic vector is calculated using existing technology, and this application does not improve the method for calculating the semantic vector.

[0076] The text vector and the first list of regulations are input into a pre-trained regulation recommendation model to obtain the matching similarity between each first regulation in the first list of regulations and the query statement; the role of the regulation recommendation model is to obtain the matching degree between the query statement and the initially recommended regulations (regulations in the first list of regulations), that is, the matching similarity.

[0077] Calculate the matching scores of each first regulation in the first regulation list according to the classification similarity, semantic similarity, and matching similarity, and sort the corresponding first regulations in descending order of the matching scores; the matching score = classification similarity * first preset weight + semantic similarity * second preset weight + matching similarity * third preset weight. That is, sort the regulations in the first regulation list comprehensively from three dimensions: classification similarity, semantic similarity, and matching similarity to obtain the regulations that best meet the user's needs.

[0078] In practice, even for regulation libraries of the same type, there are relatively many sub - types of regulations inside. For example, fiscal laws can be classified from fiscal revenue relations, fiscal expenditure relations, fiscal revenue and expenditure balance relations; internal fiscal relations, external fiscal relations; fiscal entity relations, fiscal procedure relations, etc. Therefore, in order to further determine the specific application types, the embodiments of the present invention also set labels for the types of regulations in the regulation library. Therefore, when calculating the matching score, the dimension of the label is introduced to further exclude irrelevant regulations and improve the matching accuracy. Specifically as follows:

[0079] Obtain the label data of the query statement and the preset label data corresponding to each first regulation in the first regulation list. The label data is used to represent the field to which the query statement belongs; input the label data and each preset label data into a pre - trained label recommendation model to obtain the label similarity of each first regulation in the first regulation list; calculate the matching scores of each first regulation in the first regulation list according to the classification similarity, semantic similarity, matching similarity, and label similarity. At this time, the matching score calculation formula is as follows:

[0080] Matching score = classification similarity * first preset weight + semantic similarity * second preset weight + matching similarity * third preset weight + label similarity * fourth preset weight.

[0081] Among them, the first preset weight, the second preset weight, the third preset weight, and the fourth preset weight are set according to actual needs. When actually setting, generally the third preset weight is the highest.

[0082] Among them, obtaining the label data of the query statement is to perform word vector conversion on the query statement, and then calculate the similarity with the word vectors of the preset labels, and select the several labels with the highest similarity as the label data of the query statement.

[0083] Select the first N2 first regulations as the second regulations according to the sorting of the matching scores, where N2 is a positive integer set according to actual needs, and N2 is less than N1. Exemplarily, N2 is 8;

[0084] Return the second regulations to the user.

[0085] Optionally, when the user enters the input interface but has not yet entered a query statement, regulations can be recommended to the user. In an optional implementation manner, the recommendation method is as follows: Obtain the total number of clicks of any regulation in the regulation library within a preset period. The total number of clicks is the sum of the number of clicks of each user on the regulation; Sort the regulations in the regulation library in descending order according to the total number of clicks; Select the top N3 regulations according to the sorting result of the total number of clicks and recommend them to the user, where N3 is a positive integer and is set according to actual needs. For example, N3 is 5. That is, the total number of clicks of all users is obtained by big data. The greater the total number of clicks, the greater the probability of using the regulation.

[0086] However, the preferences or habits of each user are different, and the regulations that users may use are also different. Only recommending according to the total number of clicks of all users cannot meet the user's needs. Therefore, the embodiment of the present invention provides another optional implementation manner: Obtain the click weight of any user for any regulation in the regulation library. The click weight is equal to the ratio of the first number of clicks to the second number of clicks. The first number of clicks is the number of clicks of the user on any regulation, and the second number of clicks is the number of clicks of the regulation with the most clicks by the user; For each regulation, add up the click weights of all users for the regulation to obtain the total click weight of the regulation; Obtain the target total click weight of the regulation with the largest value of the total click weight, and obtain the relative weight of each regulation. The relative weight is the ratio of the total click weight of the regulation to the target total click weight; If the relative weight of any regulation is less than the preset weight value, multiply the click weight of the regulation corresponding to each user by a preset coefficient to obtain the target weight of the regulation corresponding to the user. The preset coefficient is greater than 1; If the relative weight of any regulation is greater than or equal to the preset weight value, divide the click weight of the regulation corresponding to each user by the target total click weight to obtain the target weight; Sort the regulations clicked by the user in descending order according to the target weight; Select the top N4 regulations according to the sorting result of the target weight and recommend them to the user, where N4 is a positive integer and is set according to actual needs. Exemplarily, N4 is 5. The preset weight value is set according to actual needs. Exemplarily, the preset weight value is 0.5. In the embodiment of the present invention, when sorting the regulations, the sorting is performed according to the user's click weight and the total click weight of the regulation. That is, it takes into account the user's personal preferences and combines the total click weight of all users.

[0087] As an optional implementation manner of an embodiment of the present invention, obtain a user's historical query statement and the historical text vector of the historical query statement; when the user inputs a current query statement, use the BM25 algorithm to calculate the text similarity between the current query statement and any historical query statement, and calculate the vector similarity between the text vector of the current query statement and the historical text vector of any historical query statement; according to the text similarity and the vector similarity, calculate the final similarity between the current query statement and each historical query statement, where the final similarity = historical similarity * the first preset coefficient + vector similarity * the second preset coefficient; the first preset coefficient and the second preset coefficient are set according to actual needs. For example, the first preset coefficient is 80% and the second preset coefficient is 20%. Sort the historical query statements in descending order of the final similarity; according to the sorting of the final similarity, select the first N5 historical query statements from the historical query statements and recommend them to the user, where N5 is a positive integer and is set according to actual needs. Exemplarily, N5 is 5. When the user inputs a query question, query question recommendation is performed according to the historical query questions, avoiding repeated input by the user. When making recommendations, two methods are used to calculate the similarity, which is more accurate.

[0088] The specific method for matching regulations in the regulation library provided by the embodiment of the present invention, after obtaining the text vector of the query statement input by the user, determines the corresponding regulation library type of the query statement according to the text vector, so as to match regulations in the corresponding regulation library, greatly reducing the calculation amount. Then, according to the semantic vector, a first regulation list is obtained in the regulation library, further reducing the calculation amount of calculating the matching similarity in the subsequent process. Then, according to the classification similarity, semantic similarity, and matching similarity, calculate the matching score of the first regulation, and comprehensively sort the first regulation from three dimensions of regulation library classification, semantic vector, and regulation matching, so that the final sorting result is accurate, excluding unnecessary regulations, meeting the user's needs, and greatly improving the accuracy of regulation matching.

[0089] In the third embodiment, the present invention provides a device for matching regulations in a regulation library, as Figure 3 shown, including:

[0090] A text vector acquisition module 31, configured to acquire the text vector of the query statement input by the user;

[0091] A classification similarity acquisition module 32, configured to determine the corresponding regulation library type of the query statement and the classification similarity according to the text vector, where the classification similarity is used to represent the probability that the text vector belongs to the determined regulation library; specifically, the classification similarity acquisition module 32 inputs the text vector into a pre-trained regulation classification model to obtain the probability value of the query statement matching any preset type of regulation library; the regulation library with the largest probability value is used as the corresponding regulation library type, and the probability value of the corresponding regulation library type is used as the classification similarity.

[0092] It should be noted that the regulation classification model is trained using multiple teacher models, and each teacher model corresponds to a type of regulation library; when the regulation classification model is trained: partial data of the teacher models are used to train multiple student models respectively to obtain multiple trained target student models; for each target student model, the similarity between the result output by the target student model and the result output by the teacher model is calculated; according to each similarity, the weights of each target student model are determined respectively; according to each target student model and each weight, the regulation classification model is obtained.

[0093] The semantic similarity acquisition module 33 is used to calculate the semantic similarity between the text vector and the semantic vectors of all regulations in the determined regulation library, sort the corresponding regulations in descending order of semantic similarity, select the top N1 regulations as the first regulations according to the sorting of semantic similarity, and obtain the first regulation list according to the first regulations; where N1 is a positive integer;

[0094] The matching similarity acquisition module 34 is used to input the text vector and the first regulation list into a pre-trained regulation recommendation model to obtain the matching similarity between each first regulation in the first regulation list and the query statement;

[0095] The matching score acquisition module 35 is used to calculate the matching scores of each first regulation in the first regulation list according to the classification similarity, semantic similarity and matching similarity, and sort the corresponding first regulations in descending order of matching score; alternatively, the matching score acquisition module 35 obtains the label data of the query statement and the preset label data corresponding to each first regulation in the first regulation list, and the label data is used to represent the field to which the query statement belongs; input the label data and each preset label data into a pre-trained label recommendation model to obtain the label similarity of each first regulation in the first regulation list; calculate the matching scores of each first regulation in the first regulation list according to the classification similarity, semantic similarity, matching similarity and label similarity.

[0096] Among them, the matching score calculation formula is: matching score = classification similarity * first preset weight + semantic similarity * second preset weight + matching similarity * third preset weight + label similarity * fourth preset weight.

[0097] The second regulation acquisition module 36 is used to select the top N2 first regulations as the second regulations according to the sorting of the matching scores, where N2 is a positive integer and N2 is less than N1;

[0098] The regulation return module 37 is used to return the second regulations to the user.

[0099] A regulation recommendation module, which is used to obtain the total number of clicks of any regulation in the regulation library within a preset period. The total number of clicks is the sum of the number of clicks of each user on the regulation; sort the regulations in the regulation library in descending order according to the total number of clicks; select the top N3 regulations according to the sorting result of the total number of clicks and recommend them to the user, where N3 is a positive integer.

[0100] Alternatively, a regulation recommendation module is used to obtain the click weight of any user on any regulation in the regulation library. The click weight is equal to the ratio of the first click count to the second click count. The first click count is the number of clicks of the user on any regulation, and the second click count is the number of clicks of the regulation with the most clicks by the user; for each regulation, add up the click weights of all users for the regulation to obtain the total click weight of the regulation; obtain the target total click weight of the regulation with the largest total click weight value, and obtain the relative weight of each regulation. The relative weight is the ratio of the total click weight of the regulation to the target total click weight; if the relative weight of any regulation is less than the preset weight value, multiply the click weight of the regulation corresponding to each user by a preset coefficient to obtain the target weight of the regulation corresponding to the user, and the preset coefficient is greater than 1; if the relative weight of any regulation is greater than or equal to the preset weight value, divide the click weight of the regulation corresponding to each user by the target total click weight to obtain the target weight; sort the regulations clicked by the user in descending order according to the target weight; select the top N4 regulations according to the sorting result of the target weight and recommend them to the user, where N4 is a positive integer.

[0101] It further includes a question sentence recommendation module, which is used to obtain the user's historical query sentences and the historical text vectors of the historical query sentences; when the user inputs the current query sentence, use the bm25 algorithm to calculate the text similarity between the current query sentence and any historical query sentence, and calculate the vector similarity between the text vector of the current query sentence and the historical text vector of any historical query sentence; according to the text similarity and the vector similarity, calculate the final similarity between the current query sentence and each historical query sentence. The final similarity = historical similarity * the first preset coefficient + vector similarity * the second preset coefficient; sort the historical query sentences in descending order according to the final similarity; select the top N5 historical query sentences from the historical query sentences according to the sorting of the final similarity and recommend them to the user, where N5 is a positive integer.

[0102] The regulation library regulation matching device provided by the embodiment of the present invention, after obtaining the text vector of the query statement input by the user, determines the corresponding regulation library type of the query statement according to the text vector, so as to match regulations in the corresponding regulation library, greatly reducing the amount of calculation. Then, a first regulation list is obtained according to the semantic vector in the regulation library, further reducing the amount of calculation for calculating the matching similarity subsequently. After that, the matching score of the first regulation is calculated according to the classification similarity, semantic similarity, and matching similarity, and the first regulation is comprehensively sorted from three dimensions of regulation library classification, semantic vector, and regulation matching, so that the final sorting result is accurate, eliminating unnecessary regulations, meeting the user's needs, and greatly improving the accuracy of regulation matching.

[0103] The fourth embodiment, the present invention provides a regulation library regulation matching system, including:

[0104] A processor;

[0105] A memory for storing executable instructions of the processor;

[0106] The processor is configured to execute the regulation library regulation matching method provided by the first embodiment or the second embodiment.

[0107] The regulation library regulation matching system provided by the embodiment of the present invention stores the executable instructions of the processor through the memory. When the processor executes the executable instructions, it can obtain the text vector of the query statement input by the user, determine the corresponding regulation library type of the query statement according to the text vector, so as to match regulations in the corresponding regulation library, greatly reducing the amount of calculation. Then, a first regulation list is obtained according to the semantic vector in the regulation library, further reducing the amount of calculation for calculating the matching similarity subsequently. After that, the matching score of the first regulation is calculated according to the classification similarity, semantic similarity, and matching similarity, and the first regulation is comprehensively sorted from three dimensions of regulation library classification, semantic vector, and regulation matching, so that the final sorting result is accurate, eliminating unnecessary regulations, meeting the user's needs, and greatly improving the accuracy of regulation matching.

[0108] It can be understood that the same or similar parts in the above embodiments can be referred to each other, and the content not detailed in some embodiments can be seen in the same or similar content of other embodiments.

[0109] It should be noted that in the description of the present application, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present application, unless otherwise specified, the meaning of "multiple" refers to at least two.

[0110] Any process or method description depicted in a flowchart or described otherwise herein can be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a specific logical function or process. The scope of the preferred embodiments of this application includes additional implementations where functions may be executed not in the order shown or discussed, including in a substantially simultaneous manner according to the involved functions or in a reverse order, which should be understood by those skilled in the art to which the embodiments of this application pertain.

[0111] It should be understood that various parts of this application can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following technologies well-known in the art can be used: discrete logic circuits with logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits with appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0112] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried out in implementing the above-described embodiment methods can be completed by instructing relevant hardware through a program. The said program can be stored in a computer-readable storage medium, and when executed, includes one or a combination of the steps of the method embodiments.

[0113] In addition, in each embodiment of this application, the functional units can be integrated into one processing module, or each unit can exist physically alone, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0114] The above-mentioned storage medium can be a read-only memory, a magnetic disk, an optical disc, etc.

[0115] In the description of this specification, the description referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.

[0116] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limitations on the present application. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.

Claims

1. A regulation library regulation matching method, characterized in that: The following steps are involved: Get the text vector of the query statement entered by the user; Determining, based on the text vector, a type of regulatory library corresponding to the query statement and a classification similarity, wherein the classification similarity is used to indicate a probability that the text vector belongs to a determined regulatory library; Determining the type of regulatory library and classification similarity corresponding to the query statement based on the text vector includes: inputting the text vector into a pre-trained regulatory classification model to obtain a probability value of the query statement matching any type of preset regulatory library; using the regulatory library with the largest probability value as the corresponding regulatory library type, and using the probability value of the corresponding regulatory library type as the classification similarity; Calculating semantic similarity between the text vector and semantic vectors of all regulations in the determined regulation library, sorting the corresponding regulations in descending order of semantic similarity, selecting the first N1 regulations as first regulations based on the sorting of semantic similarities, and obtaining a first regulation list based on the first regulations; wherein N1 is a positive integer; Inputting the text vector and the first regulation list into a pre-trained regulation recommendation model to obtain a matching similarity between each first regulation in the first regulation list and the query statement; Calculating a matching score for each first regulation in the first regulation list according to the classification similarity, the semantic similarity, and the matching similarity, and sorting the corresponding first regulations in descending order of the matching scores; Selecting the first N2 first regulations as the second regulations according to the sorting of the matching scores, wherein N2 is a positive integer and N2 is less than N1; returning the second regulation to the user; The regulation classification model is trained using multiple teacher models, each teacher model corresponding to a type of regulation library; during training, the regulation classification model: Using part of the data of the teacher model to train multiple student models respectively, to obtain multiple trained target student models; For each target student model, calculating the similarity between the result output by the target student model and the result output by the teacher model; According to each similarity, the weight of each target student model is determined respectively; According to each target student model and each weight, the regulation classification model is obtained.

2. The method according to claim 1, characterized in that The calculating the matching score of each first regulation in the first regulation list according to the classification similarity, the semantic similarity, and the matching similarity includes: Obtaining label data of the query statement and preset label data corresponding to each first regulation in the first regulation list, wherein the label data is used to indicate the field to which the query statement belongs; Inputting the label data and each of the preset label data into a pre-trained label recommendation model to obtain label similarities of each first regulation in the first regulation list; A matching score of each first regulation in the first regulation list is calculated according to the classification similarity, the semantic similarity, the matching similarity, and the tag similarity.

3. The method according to claim 2, wherein: The matching score calculation formula is: matching score = classification similarity * first preset weight + semantic similarity * second preset weight + matching similarity * third preset weight + tag similarity * fourth preset weight.

4. The method according to claim 1, wherein Also includes: Obtain the total number of clicks on any regulation in the regulation library within a preset period, where the total number of clicks is the sum of the number of clicks on the regulation by each user; Sorting the regulations in the regulations library in descending order of the total number of clicks; According to the ranking result of the total number of clicks, the top N3 regulations are selected and recommended to the user, where N3 is a positive integer.

5. The method according to claim 1, wherein Also includes: Obtaining a click weight of any user on any regulation in the regulation library, where the click weight is equal to the ratio of a first number of clicks to a second number of clicks, where the first number of clicks is the number of clicks by the user on any regulation, and the second number of clicks is the number of clicks on the regulation with the most clicks by the user; For each regulation, add up the click weights of all users for the regulation to obtain the total click weight of the regulation; Obtain the target total click weight of the regulation with the largest total click weight, and obtain the relative weight of each regulation, where the relative weight is the ratio of the total click weight of the regulation to the target total click weight; If the relative weight of any regulation is less than the preset weight value, then the click weight of the regulation corresponding to each user is multiplied by a preset coefficient to obtain the target weight of the regulation corresponding to the user, and the preset coefficient is greater than 1; If the relative weight of any regulation is greater than or equal to the preset weight value, the target weight is obtained by dividing the click weight of the regulation corresponding to each user by the target total click weight; Sorting the regulations clicked by the user in descending order according to the target weights; The top N4 regulations are selected according to the ranking result of the target weights and recommended to the user, where N4 is a positive integer.

6. The method according to claim 1, characterized in that Also includes: Obtaining user historical query statements and historical text vectors of the historical query statements; When the user inputs a current query statement, the bm25 algorithm is used to calculate the text similarity between the current query statement and any of the historical query statements, and the vector similarity between the text vector of the current query statement and the historical text vector of any of the historical query statements; Calculate the final similarity between the current query and each historical query based on the text similarity and the vector similarity, where the final similarity = historical similarity * first preset coefficient + vector similarity * second preset coefficient; Sort the historical query statements in descending order of the final similarity; According to the final similarity ranking, the top N5 historical query statements are selected from the historical query statements and recommended to the user, where N5 is a positive integer.

7. A regulation library regulation matching device, characterized in that: include: A text vector acquisition module is used to obtain the text vector of the query statement input by the user; A classification similarity acquisition module is used to determine the type of regulatory library and classification similarity corresponding to the query statement based on the text vector, and the classification similarity is used to represent the probability that the text vector belongs to a determined regulatory library; it is specifically used to input the text vector into a pre-trained regulatory classification model to obtain a probability value that the query statement matches any preset type of regulatory library; the regulatory library with the largest probability value is used as the corresponding regulatory library type, and the probability value of the corresponding regulatory library type is used as the classification similarity; wherein, the regulatory classification model is trained using multiple teacher models, and each teacher model corresponds to a regulatory library type; when training the regulatory classification model: multiple student models are trained separately using part of the data of the teacher model to obtain multiple trained target student models; for each target student model, the similarity between the result output by the target student model and the result output by the teacher model is calculated; according to each similarity, the weight of each target student model is determined respectively; according to each target student model and each weight, the regulatory classification model is obtained; a semantic similarity acquisition module, configured to calculate the semantic similarity between the text vector and the semantic vectors of all regulations in the determined regulations library, sort the corresponding regulations in descending order of the semantic similarity, select the first N1 regulations as the first regulations based on the sorting of the semantic similarity, and obtain a first regulations list based on the first regulations; wherein N1 is a positive integer; a matching similarity acquisition module, configured to input the text vector and the first regulation list into a pre-trained regulation recommendation model to obtain a matching similarity between each first regulation in the first regulation list and the query statement; a matching score acquisition module, configured to calculate a matching score for each first regulation in the first regulation list based on the classification similarity, the semantic similarity, and the matching similarity, and to sort the corresponding first regulations in descending order of the matching scores; A second regulation acquisition module is configured to select the first N2 first regulations as the second regulations according to the sorting of the matching scores, wherein N2 is a positive integer and N2 is less than N1; A regulations returning module is used to return the second regulations to the user.

8. A regulation database regulation matching system, characterized by: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method, device and system for weight estimation

    CN104252456A

  • Query intention determination method and device and processing equipment

    CN111488426A