Supervision clause matching system and method based on large language model

Through a regulatory clause matching system based on a large language model, the matching model and similarity model of the regulatory clauses and inspection record database are used to achieve efficient matching of regulatory clauses, solving the problem of matching difficulties of grassroots supervisors, and improving the efficiency of supervision work and Data accuracy.

CN119201963AInactive Publication Date: 2024-12-27上海市大数据中心

Patent Information

Application Number
CN202411289192.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-12-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

It is difficult for grassroots supervisors to accurately match and select suitable regulatory inspection clauses, resulting in low efficiency in supervision work and inaccurate statistical analysis. The existing regulatory provision matching system relies on professional knowledge and is less efficient.

Method used

The regulatory clause matching system is constructed based on the large language model. By building a regulatory clause database and an inspection record database, a regulatory clause matching model and a clause similarity model are established, and a self-supervised learning module is used to correct it to realize the two aspects of inspection record data and supervision clause data. match and correction.

Benefits of technology

It improves the accuracy of matching regulatory clauses, reduces the time overhead of inspectors in the on-site selection process, saves manual matching steps, and improves regulatory work efficiency and data accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201963A_ABST
    Figure CN119201963A_ABST
Patent Text Reader

Abstract

The invention discloses a supervision clause matching system and method based on a large language model, and relates to the technical field of supervision clause matching. According to the invention, the supervision clause matching module carries out two-time clause matching operation on inspection record data input by an inspector, the secondary matching module operates a clause similarity model to carry out secondary matching on a matching result, and a supervision clause matching degree in a threshold value is selected from a plurality of supervision clause matching degrees; a reference term N + corresponding to the supervision term matching degree within the threshold value is a standard supervision term, and the supervision term with the high matching degree with the condition keyword in the primary matching result is screened out through secondary matching to serve as the standard supervision term; and finally, a supervision clause correction module is used for carrying out spatial model structure and loss function calculation on the secondary matching result, so that the accuracy of the supervision clause matching result is improved, an inspector does not need to manually select a standard supervision clause from the primary matching result, and the time required by the inspector in the field inspection process is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of regulatory clause matching, and in particular to a regulatory clause matching system and method based on a large language model. Background Art

[0002] At present, regulators of drugs, medical devices and cosmetics supervise related companies based on the Drug Administration Law, Medical Device Supervision and Management Provisions and Cosmetics Supervision and Management Regulations. They match the problems found during on-site supervision with the corresponding provisions so that they can issue documents to guide businesses to make rectifications, pay fines, suspend business, etc. Therefore, regulators need to master a large number of regulations to meet the requirements of on-site supervision. Large language models are a type of basic model that has been trained with a large amount of data to enable it to understand and generate natural language and other types of content, and to understand and generate text and other forms of content like humans to perform various tasks; such as summarizing text and answering questions.

[0003] However, many grassroots regulators currently cannot fully grasp the regulatory inspection clauses corresponding to various types of enterprises. When entering inspection information, they can only enter a summary, and need to spend a lot of time selecting appropriate regulatory inspection clauses. Wrong selections often occur, which seriously affects the efficiency of regulatory work and the accuracy of subsequent statistical analysis.

[0004] The current regulatory clause matching system automatically matches a large number of possible clauses after the inspectors complete the inspection summary on site. The inspectors are required to browse the matching results one by one and manually select the final matching results. This process still relies on the inspectors' own professional knowledge reserves and leads to lower efficiency of on-site inspections by inspectors. Summary of the invention

[0005] The purpose of the present invention is to provide a regulatory clause matching system and method based on a large language model to solve the problems raised in the prior art.

[0006] To achieve the above object, the present invention provides the following technical solution: a regulatory clause matching method based on a large language model, the method comprising:

[0007] Step S1: Build a regulatory terms database, collect and organize various regulatory terms data, and update various regulatory terms data in real time;

[0008] Step S2: construct an inspection record database, collect and organize existing inspection record data, and update the inspection record data in real time;

[0009] Step S3: constructing a regulatory clause matching model based on the regulatory clause database and the inspection record database, wherein the regulatory clause matching model matches the regulatory clause data with the inspection record data, and the matching result is stored in a data storage module;

[0010] Step S4: establishing a regulatory clause search engine based on the regulatory clause matching model, wherein the inspector inputs the inspection record data into the regulatory clause search engine, extracts conditional keywords from the inspection record data, matches the conditional keywords with the data in the regulatory clause matching model, and obtains an initial matching result;

[0011] Step S5: construct a clause similarity model based on the regulatory clause search engine, and perform the clause similarity model on the matching results obtained in step S4; obtain a secondary matching result between the inspection record data and the regulatory clause data;

[0012] Step S6: The self-supervised learning module corrects the result in step S5.

[0013] The step S3 comprises:

[0014] S31: construct a model training module based on the large language model, judge and analyze the existing regulatory clause information in the data storage module, and use the existing regulatory clause information to train the regulatory clause matching model and clause similarity model;

[0015] S32: A regulatory clause matching module is constructed based on the data processing module, and the data analysis module matches the regulatory clause data with the inspection record data through a regulatory clause matching model.

[0016] The step S5 comprises:

[0017] Step S51, sorting the initial matching results obtained in step S4 to obtain a set of regulatory clauses for a clause similarity model;

[0018] Step S52: select a regulatory clause in the regulatory clause set as the benchmark clause N+, and the remaining regulatory clauses in the regulatory clause set as the comparison clauses. The benchmark clause N+ and the remaining comparison clauses constitute a pairing group. Use the clause similarity model to calculate the similarity value N+ between each comparison clause and the benchmark clause in a pairing group, and obtain a number of similarities under the benchmark clause N+ condition; calculate the average value of the several similarity values ​​as the regulatory clause matching degree under the benchmark clause N+ condition;

[0019] Step S53: Each regulatory clause in the regulatory clause set is selected in turn as the benchmark clause N+ in step S52, and step S52 is repeated to obtain a plurality of regulatory clause matching degrees;

[0020] Step S54: Select a regulatory clause matching degree within a threshold from a number of regulatory clause matching degrees, and the benchmark clause N+ corresponding to the regulatory clause matching degree within the threshold is a standard regulatory clause; the standard regulatory clause is the secondary matching result between the inspection record data and the regulatory clause data.

[0021] The step S52 of using the clause similarity model to calculate the similarity between each comparison clause and the benchmark clause includes:

[0022] Step S521, pre-process the text of the regulatory clauses, add a partition between the upper and lower sentences of each comparison clause, and use a vectorization module to vectorize the regulatory clauses to obtain sentence vectors and position vectors. The word vectors of the clause text are learned by classifying the context words of the comparison clauses, and the word vectors of the clause text are output. The word vectors are added and averaged to obtain the clause vector as an embedding vector; the word vector, sentence vector, position vector and embedding vector are combined and added as an input vector; the input vector x of the comparison clause and the input vector y of the benchmark clause N+ are obtained respectively; the embedding vector contains a large amount of professional knowledge related to the supervisory clauses. The embedding vector is added to the input vector, and the corresponding knowledge is integrated into the large language learning model, which can improve the language model's refined understanding and learning of the regulatory corpus.

[0023] Step S522: Input the input x of the comparison clause and the input vector y of the benchmark clause N+ into the clause similarity model to obtain the similarity value between x and y. The calculation formula is:

[0024]

[0025] Among them, x and y represent two clause vectors in the comparison clause, both of which are n-dimensional vectors, and sim(x, y) represents the similarity value of clause vectors x and y. The cosine value of the angle between the two spatial clause vectors is used to measure the difference between two individuals, and the similarity value is set between the standard 0 and 1. The closer the value is to 1, the closer the angle of the surface clause vector is to 0 degrees, that is, the higher the similarity of the clauses, and a large number of clause vectors can be processed accurately and quickly.

[0026] The step S6 comprises:

[0027] Step S61, the self-supervised learning module determines whether the comparison terms can be output in the format of similar term vectors according to the sim(x, y) value in step S522; if so, the term vector is passed to the inverted index and a similar term vector set is output; if not, the comparison terms outside the similar term vector set are deleted;

[0028] Step S62, the self-supervised learning module inputs the comparison clause X, performs different data enhancements on the comparison clause through data transformation operations W1 and W2, constructs semantically similar clause sample pairs, obtains X1 and X2, inputs the data enhanced result into the encoder, obtains encoding results F1 and F2, inputs the encoding results into multiple perceptrons, obtains comparison clause text features w1 and w2, compares the benchmark clause N+ with semantically similar clauses, and also compares the benchmark clause N+ with non-semantically similar clauses, and obtains low-dimensional comparison clause text features w1 and w2 through the spatial structure model structure and loss function, which facilitates comparative learning.

[0029] The spatial model structure and loss function in step S62 include:

[0030] The semantically similar clauses are mapped to similar positions in the structural space, and the semantically dissimilar clauses are mapped to the edge of the structural space. The loss function of contrastive learning is constructed as follows:

[0031]

[0032] Where N represents the number of elements in the similar clause vector set, sim(w1, w2) represents the cosine similarity, and γ represents the temperature hyperparameter; sim(w1, w2) represents the similarity value of the text features of the comparison clauses, and w1 and w2 are both n-dimensional vectors;

[0033] Given a distribution P1 of semantically similar clause sample pairs, calculate the expected distance L1 of the vectors of semantically similar clause sample pairs, and determine the spatial distribution distance of the vectors corresponding to the semantically similar clauses according to the L1 value. The smaller L1 is, the closer the spatial distribution distance of the vectors corresponding to the semantically similar clauses is, and the more in line with the target; the calculation formula of L1 is:

[0034] L1=log (x1,x2)~P1 E×P(x1)-P(x2)P(1);

[0035] Among them, log (x1,x2)~P1 E is the expected function, P() is the encoder;

[0036] Given a data distribution P2, calculate L2 to measure the uniformity of the input vector mapped to the unit hypersphere. The smaller L2 is, the larger the spatial distance between similar term vectors is, indicating that the overall input vector distribution is more uniform and more in line with the target. Output the final matching result.

[0037] The inspection record data is a summary text, and the matching result is a number of regulatory clause data corresponding to each condition keyword.

[0038] A regulatory terms matching system based on a large language model, the system comprising:

[0039] The user end is used to establish a regulatory clause search engine based on the regulatory clause matching model, and the inspector inputs the inspection record data into the regulatory clause search engine, and after processing, the secondary matching result of the inspection record data is displayed to the inspector on the regulatory clause search engine page;

[0040] The transmission end is used to realize data transmission between the user end and the data processing end, adapt to data transmission between different transmission structures, and perform security monitoring and detection on the transmitted data;

[0041] The data processing end is used to match the inspection record data entered by the inspector into the regulatory terms search engine to the regulatory terms.

[0042] The data processing end includes:

[0043] Regulatory clause matching module, used to match inspection record data with various regulatory clause data;

[0044] The regulatory clause correction module is used to further correct the secondary matching results obtained by the clause similarity model and output the final matching results;

[0045] The data storage module is used to store historical and updated regulatory terms data, historical and updated inspection record data and historical and updated regulatory terms information, and to retrieve required data from the data storage module during model learning and use.

[0046] The regulatory terms matching module includes:

[0047] A primary matching module, used for running a regulatory clause matching model based on the regulatory clause database and the inspection record database, the regulatory clause matching model matches the regulatory clause data with the inspection record data, and the matching result is stored in the data storage module;

[0048] The secondary matching module is used to run the clause similarity model to perform secondary matching on the matching results, and obtain the final regulatory clause information after the secondary matching, that is, the final matching result between the inspection record data and the regulatory clause data obtained based on the clause similarity model.

[0049] Compared with the prior art, the present invention has the following beneficial effects:

[0050] The present invention performs two clause matching operations on the inspection record data input by the inspector through the regulatory clause matching module. The first matching module runs a regulatory clause matching model based on the regulatory clause database and the inspection record database, and the number of clauses in the initial matching result obtained is relatively large; then the clause similarity model is run through the secondary matching module to perform secondary matching on the matching result. In the secondary matching process, a baseline clause N+ and the remaining comparison clauses constitute a pairing group, and the average value of the similarity value in each pairing group is used as the regulatory clause matching degree under the baseline clause N+ condition, and the regulatory clauses within the threshold are selected from a number of regulatory clause matching degrees. Matching degree: the benchmark clause N+ corresponding to the matching degree of the regulatory clause within the threshold is the standard regulatory clause. The initial matching results are screened through secondary matching, and the regulatory clauses with high matching degree with the conditional keywords in the initial matching results are screened out as standard regulatory clauses. Finally, the regulatory clause correction module is used to calculate the spatial model structure and loss function of the secondary matching results. The larger the spatial distance of similar clause vectors, the more uniform the overall input vector distribution is, and the more in line with the target is, which improves the accuracy of the regulatory clause matching results. There is no need for inspectors to manually select standard regulatory clauses in the initial matching results, saving the time required by inspectors during on-site inspections. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 A flowchart of a regulatory clause matching method based on a large language model of the present invention;

[0052] Figure 2 It is a structural schematic diagram of a regulatory clause matching system based on a large language model of the present invention. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] Example: Figure 1 As shown, the present invention provides a regulatory clause matching method based on a large language model, the method comprising:

[0055] Step S1: Build a regulatory terms database, collect and organize various regulatory terms data, and update various regulatory terms data in real time;

[0056] Step S2: construct an inspection record database, collect and organize existing inspection record data, and update the inspection record data in real time;

[0057] Step S3: constructing a regulatory clause matching model based on the regulatory clause database and the inspection record database, wherein the regulatory clause matching model matches the regulatory clause data with the inspection record data, and the matching result is stored in a data storage module;

[0058] Step S4: establishing a regulatory clause search engine based on the regulatory clause matching model, wherein the inspector inputs the inspection record data into the regulatory clause search engine, extracts conditional keywords from the inspection record data, matches the conditional keywords with the data in the regulatory clause matching model, and obtains an initial matching result;

[0059] Step S5: construct a clause similarity model based on the regulatory clause search engine, and perform the clause similarity model on the matching results obtained in step S4; obtain a secondary matching result between the inspection record data and the regulatory clause data;

[0060] Step S6: The self-supervised learning module corrects the result in step S5.

[0061] The step S3 comprises:

[0062] S31: construct a model training module based on the large language model, judge and analyze the existing regulatory clause information in the data storage module, and use the existing regulatory clause information to train the regulatory clause matching model and clause similarity model;

[0063] S32: A regulatory clause matching module is constructed based on the data processing module, and the data analysis module matches the regulatory clause data with the inspection record data through a regulatory clause matching model.

[0064] The step S5 comprises:

[0065] Step S51, sorting the initial matching results obtained in step S4 to obtain a set of regulatory clauses for a clause similarity model;

[0066] For example, the inspector enters the condition keyword A in the inspection record data in the regulatory terms search engine. 1 ;

[0067] For condition keyword A 1 The initial matching result: Regulatory terms N 1 、Regulatory terms 2 、Regulatory terms 3 …Regulatory termsN n ;

[0068] Step S52: select a regulatory clause in the regulatory clause set as the benchmark clause N+, and the remaining regulatory clauses in the regulatory clause set as the comparison clauses. The benchmark clause N+ and the remaining comparison clauses constitute a pairing group. Use the clause similarity model to calculate the similarity value N+ between each comparison clause and the benchmark clause in a pairing group, and obtain a number of similarities under the benchmark clause N+ condition; calculate the average value of the several similarity values ​​as the regulatory clause matching degree under the benchmark clause N+ condition;

[0069] For example: Based on the regulatory clause N 1 As the base clause N+, the regulatory clause N 2 、Regulatory terms 3 …Regulatory termsN n As the comparison terms, we get the pairing group one;

[0070] By regulatory terms N 2 As the base clause N+, the regulatory clause N 1 、Regulatory terms 3 …Regulatory termsN n As the comparison terms, we get the pairing group 2;

[0071] ..., and obtain pairing group n.

[0072] Step S53: Each regulatory clause in the regulatory clause set is selected in turn as the benchmark clause N+ in step S52, and step S52 is repeated to obtain a plurality of regulatory clause matching degrees;

[0073] Step S54: Select a regulatory clause matching degree within a threshold from a number of regulatory clause matching degrees, and the benchmark clause N+ corresponding to the regulatory clause matching degree within the threshold is a standard regulatory clause; the standard regulatory clause is the secondary matching result between the inspection record data and the regulatory clause data.

[0074] The step S52 of using the clause similarity model to calculate the similarity between each comparison clause and the benchmark clause includes:

[0075] Step S521, pre-process the text of the regulatory clauses, add a partition between the upper and lower sentences of each comparison clause, and use a vectorization module to vectorize the regulatory clauses to obtain sentence vectors and position vectors. The word vectors of the clause text are learned by classifying the context words of the comparison clauses, and the word vectors of the clause text are output. The word vectors are added and averaged to obtain the clause vector as an embedding vector; the word vector, sentence vector, position vector and embedding vector are combined and added as an input vector; the input vector x of the comparison clause and the input vector y of the benchmark clause N+ are obtained respectively; the embedding vector contains a large amount of professional knowledge related to the supervisory clauses. The embedding vector is added to the input vector, and the corresponding knowledge is integrated into the large language learning model, which can improve the language model's refined understanding and learning of the regulatory corpus.

[0076] Step S522: Input the input x of the comparison clause and the input vector y of the benchmark clause N+ into the clause similarity model to obtain the similarity value between x and y. The calculation formula is:

[0077]

[0078] Among them, x and y represent two clause vectors in the comparison clause, both of which are n-dimensional vectors, and sim(x, y) represents the similarity value of clause vectors x and y. The cosine value of the angle between the two spatial clause vectors is used to measure the difference between two individuals, and the similarity value is set between the standard 0 and 1. The closer the value is to 1, the closer the angle of the surface clause vector is to 0 degrees, that is, the higher the similarity of the clauses, and a large number of clause vectors can be processed accurately and quickly.

[0079] The step S6 comprises:

[0080] Step S61, the self-supervised learning module determines whether the comparison terms can be output in the format of similar term vectors according to the sim(x, y) value in step S522; if so, the term vector is passed to the inverted index and a similar term vector set is output; if not, the comparison terms outside the similar term vector set are deleted;

[0081] Step S62, the self-supervised learning module inputs the comparison clause X, performs different data enhancements on the comparison clause through data transformation operations W1 and W2, constructs semantically similar clause sample pairs, obtains X1 and X2, inputs the data enhanced result into the encoder, obtains encoding results F1 and F2, inputs the encoding results into multiple perceptrons, obtains comparison clause text features w1 and w2, compares the benchmark clause N+ with semantically similar clauses, and also compares the benchmark clause N+ with non-semantically similar clauses, and obtains low-dimensional comparison clause text features w1 and w2 through the spatial structure model structure and loss function, which facilitates comparative learning.

[0082] The spatial model structure and loss function in step S62 include:

[0083] The semantically similar clauses are mapped to similar positions in the structural space, and the semantically dissimilar clauses are mapped to the edge of the structural space. The loss function of contrastive learning is constructed as follows:

[0084]

[0085] Where N represents the number of elements in the similar clause vector set, sim(w1, w2) represents the cosine similarity, and γ represents the temperature hyperparameter; sim(w1, w2) represents the similarity value of the text features of the comparison clauses, and w1 and w2 are both n-dimensional vectors;

[0086] Given a distribution P1 of semantically similar clause sample pairs, calculate the expected distance L1 of the vectors of semantically similar clause sample pairs, and determine the spatial distribution distance of the vectors corresponding to the semantically similar clauses according to the L1 value. The smaller L1 is, the closer the spatial distribution distance of the vectors corresponding to the semantically similar clauses is, and the more in line with the target; the calculation formula of L1 is:

[0087] L1=log (x1,x2)~P1 E×P(x1)-P(x2)P(1);

[0088] Among them, log (x1,x2)~P1 E is the expected function, P() is the encoder;

[0089] Given a data distribution P2, calculate L2 to measure the uniformity of the input vector mapped to the unit hypersphere. The smaller L2 is, the larger the spatial distance between similar term vectors is, indicating that the overall input vector distribution is more uniform and more in line with the target. Output the final matching result.

[0090] The inspection record data is a summary text, and the matching result is a number of regulatory clause data corresponding to each condition keyword.

[0091] Figure 2 , a regulatory terms matching system based on a large language model, the system comprising:

[0092] The user end is used to establish a regulatory clause search engine based on the regulatory clause matching model, and the inspector inputs the inspection record data into the regulatory clause search engine, and after processing, the secondary matching result of the inspection record data is displayed to the inspector on the regulatory clause search engine page;

[0093] The transmission end is used to realize data transmission between the user end and the data processing end, adapt to data transmission between different transmission structures, and perform security monitoring and detection on the transmitted data;

[0094] The data processing end is used to match the inspection record data entered by the inspector into the regulatory terms search engine to the regulatory terms.

[0095] The data processing end includes:

[0096] Regulatory clause matching module, used to match inspection record data with various regulatory clause data;

[0097] The regulatory clause correction module is used to further correct the secondary matching results obtained by the clause similarity model and output the final matching results;

[0098] The data storage module is used to store historical and updated regulatory terms data, historical and updated inspection record data and historical and updated regulatory terms information, and to retrieve required data from the data storage module during model learning and use.

[0099] The regulatory terms matching module includes:

[0100] A primary matching module, used for running a regulatory clause matching model based on the regulatory clause database and the inspection record database, the regulatory clause matching model matches the regulatory clause data with the inspection record data, and the matching result is stored in the data storage module;

[0101] The secondary matching module is used to run the clause similarity model to perform secondary matching on the matching results, and obtain the final regulatory clause information after the secondary matching, that is, the final matching result between the inspection record data and the regulatory clause data obtained based on the clause similarity model.

[0102] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

Claims

1. A regulatory clause matching method based on a large language model, characterized by: The method includes: Step S1: Build a regulatory terms database, collect and organize various regulatory terms data, and update various regulatory terms data in real time; Step S2: construct an inspection record database, collect and organize existing inspection record data, and update the inspection record data in real time; Step S3: constructing a regulatory clause matching model based on the regulatory clause database and the inspection record database, wherein the regulatory clause matching model matches the regulatory clause data with the inspection record data, and the matching result is stored in a data storage module; Step S4: establishing a regulatory clause search engine based on the regulatory clause matching model, wherein the inspector inputs the inspection record data into the regulatory clause search engine, extracts conditional keywords from the inspection record data, matches the conditional keywords with the data in the regulatory clause matching model, and obtains an initial matching result; Step S5: construct a clause similarity model based on the regulatory clause search engine, and perform the clause similarity model on the matching results obtained in step S4; obtain a secondary matching result between the inspection record data and the regulatory clause data; Step S6: The self-supervised learning module corrects the result in step S5.

2. The regulatory clause matching method based on a large language model according to claim 1, characterized in that: The step S3 comprises: S31: construct a model training module based on the large language model, judge and analyze the existing regulatory clause information in the data storage module, and use the existing regulatory clause information to train the regulatory clause matching model and clause similarity model; S32: constructing a regulatory clause matching module based on the data processing module, and the data analysis module matches the regulatory clause data with the inspection record data through a regulatory clause matching model.

3. The regulatory clause matching method based on a large language model according to claim 2, characterized in that: The step S5 comprises: Step S51, sorting the initial matching results obtained in step S4 to obtain a set of regulatory clauses for a clause similarity model; Step S52: select a regulatory clause in the regulatory clause set as the benchmark clause N+, and the remaining regulatory clauses in the regulatory clause set as the comparison clauses. The benchmark clause N+ and the remaining comparison clauses constitute a pairing group. Use the clause similarity model to calculate the similarity value N+ between each comparison clause and the benchmark clause in a pairing group, and obtain a number of similarities under the benchmark clause N+ condition; calculate the average value of the several similarity values ​​as the regulatory clause matching degree under the benchmark clause N+ condition; Step S53: Each regulatory clause in the regulatory clause set is selected in turn as the benchmark clause N+ in step S52, and step S52 is repeated to obtain a plurality of regulatory clause matching degrees; Step S54: Select a regulatory clause matching degree within a threshold from a number of regulatory clause matching degrees, and the benchmark clause N+ corresponding to the regulatory clause matching degree within the threshold is a standard regulatory clause; the standard regulatory clause is the secondary matching result between the inspection record data and the regulatory clause data.

4. The regulatory clause matching method based on a large language model according to claim 3 is characterized by: The step S52 of using the clause similarity model to calculate the similarity between each comparison clause and the benchmark clause includes: Step S521, pre-process the text of the regulatory clause, add a partition between the upper and lower sentences of each comparison clause, and the vectorization module vectorizes the regulatory clause to obtain a sentence vector and a position vector. The word vector of the clause text is learned by classifying the context words of the comparison clause, and the word vector of the clause text is output. The word vectors are added and averaged to obtain the clause vector as an embedding vector; the word vector, sentence vector, position vector and embedding vector are combined and added as an input vector; the input vector x of the comparison clause and the input vector y of the benchmark clause N+ are obtained respectively; Step S522: Input the input x of the comparison clause and the input vector y of the benchmark clause N+ into the clause similarity model to obtain the similarity value between x and y. The calculation formula is: Among them, x and y represent two clause vectors in the comparison clause, both of which are n-dimensional vectors, and sim(x, y) represents the similarity value of clause vectors x and y.

5. The regulatory clause matching method based on a large language model according to claim 4, characterized in that: The step S6 comprises: Step S61, the self-supervised learning module determines whether the comparison terms can be output in the format of similar term vectors according to the sim(x, y) value in step S522; if so, the term vector is passed to the inverted index and a similar term vector set is output; if not, the comparison terms outside the similar term vector set are deleted; Step S62, the self-supervised learning module inputs the comparison clause X, performs different data enhancements on the comparison clause through data transformation operations W1 and W2, constructs semantically similar clause sample pairs, obtains X1 and X2, inputs the data enhanced results into the encoder, obtains encoding results F1 and F2, inputs the encoding results into multiple perceptrons, and obtains the comparison clause text features w1 and w2 through the spatial structure model structure and loss function.

6. A regulatory clause matching method based on a large language model according to claim 5, characterized in that: The spatial model structure and loss function in step S62 include: The semantically similar clauses are mapped to similar positions in the structural space, and the semantically dissimilar clauses are mapped to the edge of the structural space. The loss function of contrastive learning is constructed as follows: Where N represents the number of elements in the similar clause vector set, sim(w1, w2) represents the cosine similarity, and γ represents the temperature hyperparameter; sim(w1, w2) represents the similarity value of the text features of the comparison clauses, and w1 and w2 are both n-dimensional vectors; Given a distribution P1 of semantically similar clause sample pairs, calculate the expected distance L1 of the vectors of semantically similar clause sample pairs, and determine the spatial distribution distance of the vectors corresponding to the semantically similar clauses according to the L1 value; the calculation formula of L1 is: L1=log (x1,x2)~P1 E×P(x1)-P(x2)P(1); Among them, log (x1,x2)~P1 E is the expected function, P( ) is the encoder; Given a data distribution P2, calculate L2 to measure the uniformity of the input vector mapped to the unit hypersphere on the sphere; output the final matching result.

7. The regulatory clause matching method based on a large language model according to claim 1, characterized in that: The inspection record data is a summary text, and the matching result is a number of regulatory clause data corresponding to each condition keyword.

8. A regulatory clause matching system based on a large language model, applied to a regulatory clause matching method based on a large language model as described in any one of claims 1 to 7, characterized in that: The system includes: The user end is used to establish a regulatory clause search engine based on the regulatory clause matching model, and the inspector inputs the inspection record data into the regulatory clause search engine, and after processing, the secondary matching result of the inspection record data is displayed to the inspector on the regulatory clause search engine page; The transmission end is used to realize data transmission between the user end and the data processing end, adapt to data transmission between transmission ends with different transmission structures, and perform security monitoring and detection on the transmitted data; The data processing end is used to match the inspection record data entered by the inspector into the regulatory terms search engine to the regulatory terms.

9. A regulatory clause matching system based on a large language model according to claim 8, characterized in that: The data processing end includes: Regulatory clause matching module, used to match inspection record data with various regulatory clause data; The regulatory clause correction module is used to further correct the secondary matching results obtained by the clause similarity model and output the final matching results; The data storage module is used to store historical and updated regulatory terms data, historical and updated inspection record data and historical and updated regulatory terms information, and to retrieve required data from the data storage module during model learning and use.

10. A regulatory clause matching system based on a large language model according to claim 9, characterized in that: The regulatory terms matching module includes: A primary matching module, used for running a regulatory clause matching model based on the regulatory clause database and the inspection record database, the regulatory clause matching model matches the regulatory clause data with the inspection record data, and the matching result is stored in the data storage module; The secondary matching module is used to run the clause similarity model to perform secondary matching on the matching results, and obtain the final regulatory clause information after the secondary matching, that is, the final matching result between the inspection record data and the regulatory clause data obtained based on the clause similarity model.

Citation Information

Patent Citations

  • Inspection result intelligent matching method and system based on a natural language

    CN109614477A

  • Information search method and device, computer equipment and storage medium

    CN111859079A

  • Contract term risk check method, system and device and storage medium

    CN116843175A

  • Clause selection method and device and electronic equipment

    CN117931880A

Cited By

  • Technical supervision system and data processing method for power equipment

    CN121212367A

  • Technical supervision system of power equipment and data processing method

    CN121212367B