Audit method and device, electronic equipment and storage medium

By constructing an audit rule knowledge base and an entity relationship extraction model, the problems of low efficiency and insufficient accuracy of existing audit methods are solved, realizing the automation and intelligence of text auditing and improving audit efficiency and accuracy.

CN115408529BActive Publication Date: 2026-02-13CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110586905.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-27
Publication Date
2026-02-13
Estimated Expiration
2041-05-27

AI Technical Summary

Technical Problem

Existing auditing methods are inefficient and inaccurate, especially in management information systems where there are inconsistencies in data across domains, platforms, and systems involving massive amounts of documents, resulting in a large workload and insufficient accuracy for manual auditing.

Method used

By constructing an audit rule knowledge base, entities and relationships in the text to be audited are extracted using an entity relationship extraction model. The audit rule knowledge base is then used for automated auditing, including feature vector extraction from the entity relationship extraction model and querying audit rules. The dictionary and training model are updated regularly to adapt to business changes.

Benefits of technology

It has achieved automation and intelligence in text auditing, reduced manual intervention, improved auditing efficiency and accuracy, and reduced personnel costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408529B_ABST
    Figure CN115408529B_ABST
Patent Text Reader

Abstract

The application provides an auditing method and device, electronic equipment and a storage medium, wherein the method comprises: determining a text to be audited; performing entity relationship extraction on the text to be audited to obtain an entity to be audited contained in the text to be audited and a relationship between the entities to be audited; querying the entity to be audited and the relationship between the entities to be audited in an auditing rule knowledge base, and determining an auditing result of the text to be audited based on a query result; wherein the auditing rule knowledge base contains legal entities contained in sample legal texts and relationships between the legal entities. The application realizes automatic intelligent auditing of the text, greatly reduces the participation of manual work, reduces the auditing cost of personnel, improves the efficiency of text auditing, and improves the accuracy of auditing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of natural language processing, and particularly relates to an auditing method and device, electronic equipment and a storage medium. BACKGROUND

[0002] With the vigorous development of mobile Internet, Internet of Things, cloud computing, big data and other technologies, higher challenges are put forward to enterprise risk prevention and control capabilities such as business data standardization, data consistency, and automatic auditing of business data.

[0003] The current auditing method usually extracts auditing rules in the form of manual reading. However, there are a large number of management method (standard) documents in the management information system, and there are problems of inconsistency of data between cross-domain, cross-platform and cross-system. Therefore, the manual sorting method has the risk of large workload and incomplete extraction of auditing rules, resulting in insufficient auditing accuracy. SUMMARY

[0004] The present application provides an auditing method, device, electronic equipment and storage medium to solve the defects of low auditing efficiency and insufficient accuracy in the prior art.

[0005] The present application provides an auditing method, comprising:

[0006] determining a text to be audited;

[0007] performing entity relationship extraction on the text to be audited to obtain entities to be audited contained in the text to be audited and relationships between the entities to be audited;

[0008] querying the entities to be audited and the relationships between the entities to be audited in an auditing rule knowledge base, and determining an auditing result of the text to be audited based on the query result;

[0009] The auditing rule knowledge base contains legal entities contained in a sample legal text and relationships between the legal entities.

[0010] According to the auditing method provided by the present application, the entity relationship extraction on the text to be audited is performed to obtain the entities to be audited contained in the text to be audited and the relationships between the entities to be audited, which specifically comprises:

[0011] extracting a word feature vector of each token in the text to be audited based on a feature vector extraction layer in an entity relationship extraction model;

[0012] extracting the entities to be audited contained in the text to be audited and the relationships between the entities to be audited based on an entity relationship determination layer in the entity relationship extraction model in combination with the word feature vector of each token in the text to be audited;

[0013] The entity relation extraction model is trained based on sample legal texts, legal entities contained in the sample legal texts, and relations between the legal entities.

[0014] According to the auditing method provided by the application, the feature vector extraction layer in the entity relation extraction model is used to extract the word feature vector of each segmented word in the text to be audited, and specifically includes the following steps.

[0015] Based on the position of each segmented word in the text to be audited in the text to be audited, the position encoding of each segmented word in the text to be audited is determined.

[0016] Based on the word feature extraction layer in the feature vector extraction layer, the word feature encoding of each segmented word in the text to be audited is extracted in combination with the one-hot encoding of each segmented word in the text to be audited.

[0017] The position encoding and the word feature encoding of each segmented word in the text to be audited are fused to obtain the word feature vector of each segmented word in the text to be audited.

[0018] According to the auditing method provided by the application, the position of each segmented word in the text to be audited in the text to be audited is determined, and specifically includes the following steps.

[0019] Based on the position of each segmented word in the text to be audited in the text to be audited, the feature value of each segmented word in the text to be audited is determined.

[0020] If the position of any segmented word in the text to be audited is an odd position, the feature value of the any segmented word is encoded by using a cosine function to obtain the position encoding of the any segmented word.

[0021] Otherwise, the feature value of the any segmented word is encoded by using a sine function to obtain the position encoding of the any segmented word.

[0022] 6、According to the auditing method provided by the application, before training the entity relation extraction model, the following steps are further included.

[0023] Obtain the training item of each sample segmented word in the sample legal text; the training item of any sample segmented word includes the sample segmented words in a fixed window before and after the any sample segmented word.

[0024] Based on the one-hot encoding of the training item of each sample segmented word in the sample legal text, the word feature extraction layer is pre-trained.

[0025] According to the auditing method provided by the application, the following steps are further included.

[0026] The dictionary is updated in a timely manner.

[0027] Based on the updated dictionary, sample legal texts are obtained;

[0028] Based on the sample legal texts, legal entities contained in the sample legal texts and relationships between the legal entities, an entity relationship extraction model is retrained, and the audit rule knowledge base is updated.

[0029] According to the audit method provided by the application, the sample legal texts are obtained, and specifically include the following steps.

[0030] Based on the updated dictionary, each historical audited text is segmented, and the TF-IDF value of each historical segment in each historical audited text is counted.

[0031] Based on the TF-IDF value of each historical segment in each historical audited text, each historical audited text is clustered by using a DBSCAN clustering algorithm, and a plurality of class clusters are obtained.

[0032] The historical audited texts of a preset category are selected from the plurality of class clusters as the sample legal texts.

[0033] The application further provides an audit device, which includes:

[0034] A text determination unit is configured to determine a text to be audited.

[0035] An entity relationship extraction unit is configured to perform entity relationship extraction on the text to be audited to obtain audited entities contained in the text to be audited and relationships between the audited entities.

[0036] An audit unit is configured to query the audited entities and the relationships between the audited entities in an audit rule knowledge base, and determine an audit result of the text to be audited based on a query result.

[0037] The audit rule knowledge base contains legal entities contained in sample legal texts and relationships between the legal entities.

[0038] The application further provides an electronic device including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the audit method according to any one of the above embodiments when executing the program.

[0039] The application further provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable on a processor to implement the steps of the audit method according to any one of the above embodiments.

[0040] The auditing method, device, electronic equipment and storage medium provided by the application construct an auditing rule knowledge base based on the legal entities contained in the sample legal text and the relationships between the legal entities, query the to-be-audited entities in the to-be-audited text and the relationships between the to-be-audited entities in the auditing rule knowledge base, realize automatic intelligent auditing of the text, greatly reduce the participation of manual work, reduce the auditing cost of personnel, improve the efficiency of text auditing, and improve the accuracy of auditing. BRIEF DESCRIPTION OF DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.

[0042] Figure 1 The flowchart of the auditing method provided by the application is shown in

[0043] Figure 2 The structure diagram of the entity relationship extraction model provided by the application is shown in

[0044] Figure 3 The structure diagram of the feature extraction layer provided by the application is shown in

[0045] Figure 4 The structure diagram of the auditing device provided by the application is shown in

[0046] Figure 5 The structure diagram of the electronic equipment provided by the application is shown in DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the application more clear, the technical solutions in the application will be described clearly and completely in combination with the drawings in the application. Obviously, the described embodiments are some embodiments of the application, not all embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor belong to the protection scope of the application.

[0048] Figure 1 The flowchart of the auditing method provided by the embodiments of the application is shown in Figure 1 The method comprises the following steps.

[0049] Step 110, determining the to-be-audited text.

[0050] Specifically, the to-be-audited text which needs to be audited is acquired. After the to-be-audited text is acquired, the to-be-audited text can be segmented and the stop words can be removed by using a dictionary.

[0051] In step 120, entity relationship extraction is performed on the text to be audited to obtain the entities to be audited contained in the text to be audited and the relationships between the entities to be audited.

[0052] Specifically, according to each word in the text to be audited, entity relationship extraction is performed on the text to be audited to obtain the entities to be audited contained in the text to be audited and the relationships between the entities to be audited. The entities to be audited are entities in the text to be audited, such as an operator and an operation object of an operation behavior, and the relationship between the entities to be audited can be the operation behavior. Here, an entity relationship extraction model that has been trained can be used for entity relationship extraction.

[0053] In step 130, the entities to be audited and the relationships between the entities to be audited are queried in the audit rule knowledge base, and based on the query result, an audit result of the text to be audited is determined.

[0054] The audit rule knowledge base contains legal entities contained in sample legal texts and relationships between the legal entities.

[0055] Specifically, before intelligent auditing is performed, a large number of collected sample legal texts can be summarized and annotated to obtain legal entities contained in the sample legal texts and relationships between the legal entities, so as to construct the audit rule knowledge base. The audit rule knowledge base contains legal entities contained in sample legal texts and relationships between the legal entities. Here, the legal entities and the relationships between the legal entities can be input as audit rules into a Neo4j graph database to generate the audit rule knowledge base. Using a graph database as a rule storage engine and a search engine for rule legality auditing of text auditing rules can quickly search and maintain rules, and can display the audit rules in the graph database in a graphical manner when necessary to meet the needs of manual review or other customized production.

[0056] During auditing, the entities to be audited and the relationships between the entities to be audited can be used as query keywords to search the audit rule knowledge base. According to the query result, the audit result of the text to be audited can be determined. If the entities to be audited and the relationships between the entities to be audited can be queried in the audit rule knowledge base, the audit result of the text to be audited is audit pass; otherwise, the audit result of the text to be audited is audit failure, and a corresponding warning operation can be performed.

[0057] The method provided by the embodiment of the present application constructs an auditing rule knowledge base based on the legal entities contained in the sample legal text and the relationship between the legal entities, queries the to-be-audited entities and the relationship between the to-be-audited entities in the to-be-audited text in the auditing rule knowledge base, and realizes automatic intelligent auditing of the text, greatly reduces the participation of manual work, reduces the auditing cost of personnel, improves the efficiency of text auditing, and improves the accuracy of auditing.

[0058] Based on the above embodiment, step 120 specifically includes:

[0059] Based on the feature vector extraction layer in the entity relationship extraction model, the word feature vector of each segmented word in the to-be-audited text is extracted;

[0060] Based on the entity relationship determination layer in the entity relationship extraction model, the to-be-audited entities contained in the to-be-audited text and the relationship between the to-be-audited entities are extracted in combination with the word feature vector of each segmented word in the to-be-audited text.

[0061] The entity relationship extraction model is trained based on the sample legal text, the legal entities contained in the sample legal text, and the relationship between the legal entities.

[0062] Specifically, entity relationship extraction can be performed based on the trained entity relationship extraction model. The entity relationship extraction model can include a feature vector extraction layer and an entity relationship determination layer. The feature vector extraction layer can be used to extract the word feature vector of each segmented word in the to-be-audited text. The word feature vector of any segmented word contains semantic information of the segmented word and can also include the association relationship between the segmented word and its context. The entity relationship determination layer can be used to extract the to-be-audited entities contained in the to-be-audited text and the relationship between the to-be-audited entities based on the word feature vector of each segmented word in the to-be-audited text.

[0063] The entity relationship extraction model is trained based on the sample legal text, the legal entities contained in the sample legal text, and the relationship between the legal entities. Figure 2 The structural diagram of the entity relationship extraction model provided by the embodiment of the present application is shown in Figure 2 As shown in the figure, x is the input text, [provincial company material supply department] and [income type and no income and no branch type text] are two entities corresponding to the input text, [approval] represents the relationship between the two entities, and both are annotation data. wrd The feature vector extraction layer is used to extract the word feature vector of each segmented word in the to-be-audited text, and the remaining network units constitute the entity relationship determination layer.

[0064] d w is a hyperparameter used to control the size of the word feature vector.

[0065] w 1This variable is initialized to empty to calculate the matrix information for automatically matching dimensions based on the output of the previous layer. This variable will be updated in reverse during model training.

[0066] b 1 The bias term is a learnable term, and the data format is a vector.

[0067] z n To perform a matrix transpose of the input text using k word embeddings, the specific steps are as follows:

[0068]

[0069] r w =W wrd v w

[0070] Among them, v w This represents an array where the w-th element is 1 and all others are 0.

[0071] d c This is a hyperparameter used to control the number of units in the convolution;

[0072] r x For word feature vectors and d c The result of performing a vector product operation on the output features of the last layer shown;

[0073] W classes It is in matrix format, where the first column represents the vector parameters for each relation;

[0074] The loss function of this model can be calculated as follows:

[0075]

[0076] Where, m + and m - These represent two offset parameters, where γ represents the scaling factor and y represents the offset factor. + and c - These represent the correct relation label (i.e., "[Approval]") and the incorrect relation label, respectively. This represents the score corresponding to the correct classification of the relationship between entities. Indicates removal The maximum score other than θ represents all parameters.

[0077] The relationships between entities can be extracted in the following way:

[0078]

[0079] s(x) is the final score for each type of entity relationship. The score threshold can be set according to the actual data situation to complete the extraction of entity relationships.

[0080] Entities can be extracted using scikit-learn for named entity recognition. Basic entity information can be defined as shown in Table 1.

[0081] Table 1

[0082]

[0083] Entity annotation can adopt the IOB annotation method, where:

[0084] The "I-" prefix is ​​used to indicate that a tag is located within a block.

[0085] B- is used to indicate a prefix before a tag, signifying that the tag is the beginning of a block;

[0086] The "O" symbol indicates that the text corresponding to this symbol does not belong to any block.

[0087] Training methods can include:

[0088]

[0089] Where, algorithm = 'lbfgs' is the quasi-Newton method, c1 and c2 are hyperparameters, max_iterations represents the number of iterations, and X_train and y_train represent the input text and corresponding label data in the training data, respectively.

[0090] Entity extraction can be done in the following ways:

[0091] y_pred = crf.predict(X_test)

[0092] X_test represents the text information to be extracted, while y_pred contains the extracted entity content.

[0093] Based on any of the above embodiments, the feature vector extraction layer in the entity relation extraction model extracts the word feature vector of each word in the text to be audited, specifically including:

[0094] Based on the position of each word in the text to be audited, determine the position code of each word in the text to be audited;

[0095] Based on the word feature extraction layer in the feature vector extraction layer, and combined with the one-hot encoding of each word in the text to be audited, the word feature encoding of each word in the text to be audited is extracted.

[0096] The position encoding and the word feature encoding of each word in the text to be audited are fused to obtain a word feature vector of each word in the text to be audited.

[0097] Specifically, when the word feature vector of each word is extracted, the position encoding of each word in the text to be audited can be obtained based on the position of each word in the text to be audited. By encoding the position, more sequential information can be captured, and the semantic expression ability of the subsequent word feature vector can be improved. In addition, the word feature encoding of each word in the text to be audited can be extracted based on the word feature extraction layer in the feature vector extraction layer and combined with the one-hot encoding of each word in the text to be audited. Subsequently, the position encoding and the word feature encoding of each word in the text to be audited are fused to obtain the word feature vector of each word in the text to be audited, thereby enhancing the semantic expression ability of the word feature vector and improving the accuracy of automatic auditing.

[0098] Based on any of the above embodiments, the position encoding of each word in the text to be audited is determined based on the position of each word in the text to be audited, specifically including:

[0099] Based on the position of each word in the text to be audited, the feature value of each word in the text to be audited is determined;

[0100] If the position of any word in the text to be audited is an odd position, the feature value of the word is encoded using a cosine function to obtain the position encoding of the word;

[0101] Otherwise, the feature value of the word is encoded using a sine function to obtain the position encoding of the word.

[0102] Specifically, based on the position of each word in the text to be audited, the feature value of each word in the text to be audited is determined. The feature value of any word can be calculated in the following manner:

[0103] fea = position of the word in the text to be audited / length of the text to be audited

[0104] If the position of any word in the text to be audited is an odd position, the feature value of the word is encoded using a cosine function to obtain the position encoding of the word; otherwise, the feature value of the word is encoded using a sine function to obtain the position encoding of the word.

[0105] That is, the position encoding of any word can be determined in the following manner:

[0106]

[0107] Where i is the position information of the word, and fea is the feature value of the word.

[0108] Here, the sine function and the cosine function are used, on the one hand, because the two functions are periodic functions, so they are relatively sensitive to time and the range of change can be controlled, and on the other hand, because the range of function values can be controlled, it can also ensure that the range of data will not change too much, which helps to improve the accuracy of the word feature vector.

[0109] Based on any of the above embodiments, before training the entity relation extraction model, further comprising:

[0110] Obtaining a training item of each sample segmentation in the sample legal text; the training item of any sample segmentation includes the sample segmentation within a fixed window before and after the sample segmentation;

[0111] Based on the one-hot encoding of the training item of each sample segmentation in the sample legal text, pre-training the word feature extraction layer.

[0112] Specifically, the word feature extraction layer in the feature vector extraction layer can constitute a sub-model alone and can pre-train the sub-model before training the entire entity relation extraction model, thereby improving the model training effect and training efficiency. When pre-training the word feature extraction layer, a forward relation training method can be used. That is, a training item of each sample segmentation in the sample legal text can be obtained; wherein the training item of any sample segmentation includes the sample segmentation within a fixed window before and after the sample segmentation. Then, based on the one-hot encoding of the training item of each sample segmentation in the sample legal text, the word feature extraction layer is pre-trained, so that the word feature extraction layer can learn the semantic information of the context of any segmentation and the association between the segmentation and the context closely related to it, thereby improving the semantic extraction capability of the word feature extraction layer.

[0113] Suppose the sentence to be trained is {“provincial company material supply department”, “self-examination and approval”, “the department”, “responsible for the preparation of income and no-receipt no-disbursement text”, “and below 100 million yuan (including)”, “expenditure and receipt and disbursement text”}, for each segmentation in it, the window length can be set to 2, then the training item is:

[0114]

[0115] Figure 3 The structural diagram of the feature extraction layer provided by the embodiment of the application is shown in Figure 3 As shown in the figure, the hidden layer of the feature extraction layer can learn how to establish the word feature encoding of the segmentation t according to the one-hot encoding of the other segmentations t-2, t-1, t+1 and t+2 within the window before and after the segmentation t.

[0116] Based on any of the above embodiments, the method further comprises:

[0117] Updating the dictionary in a timely manner;

[0118] Based on the updated dictionary, obtain sample legal text;

[0119] Based on the sample legal text, the legal entities contained in the sample legal text, and the relationships between the legal entities, retrain the entity relationship extraction model and update the audit rule knowledge base.

[0120] Specifically, in actual application scenarios, new material vocabulary, engineering terminology, or organization-related special terms and other related special terms will be added to the dictionary from the relevant organization table and material table in real time to ensure the accuracy of text segmentation, word feature vector extraction, and subsequent entity relationship extraction process. This can improve the accuracy of subsequent processes.

[0121] For example, by querying the business system database regularly, relevant organization or engineering-related approval information can be obtained from the database to obtain newly added vocabulary information and update it to the custom dictionary. Then, based on the new dictionary, update the segmentation tool and automatically trigger the reacquisition of sample legal text and data labeling, retraining of entity relationship extraction model, and updating of the audit rule knowledge base, so that the system can be updated in a timely manner to meet the needs of actual business scenarios.

[0122] Based on any of the above embodiments, the sample legal text is obtained, specifically including:

[0123] Based on the updated dictionary, perform text segmentation on each historical audited text, and calculate the TF-IDF value of each historical segmentation in each historical audited text;

[0124] Using the DBSCAN clustering algorithm, based on the TF-IDF value of each historical segmentation in each historical audited text, cluster each historical audited text to obtain multiple clusters;

[0125] From the multiple clusters, select historical audited texts of a preset category as sample legal texts.

[0126] Specifically, since there are a large number of historical audited texts in the text database of the current system, and the approval points involved in the manual approval of texts of different types also have specific operation methods, the texts can be classified accordingly, so that customized operations can be performed on certain types of texts, such as constructing an audit rule knowledge base corresponding to the type of text, and an entity relation extraction model suitable for extracting entities and relations of the type of text, to improve the accuracy of subsequent processes. For example, for engineering texts, more attention is paid to the corresponding engineering completion period and engineering material audit, but for procurement texts, the focus of manual review is the unit price, quantity and delivery date of procurement, etc.

[0127] Specifically, based on the updated dictionary, the word segmentation tool can be used to segment each historical audited text to remove the stop words in the text. The segmentation of all historical audited texts is counted and stored as a set. Then, the TF-IDF value of each historical segmentation in each historical audited text is counted. The TF counting method is as follows:

[0128]

[0129] wherein ni represents the number of occurrences of the ith segmentation in the current text, k represents the total number of texts, and n k,i represents the number of occurrences of the segmentation in the kth text.

[0130] The IDF counting method is as follows:

[0131]

[0132] wherein |D| represents the total number of texts, and |{j: t i ∈ d j} represents the number of texts containing the segmentation ti. For words not in the corpus, the value of |{j: t i ∈ d j} is 0, at which time 1+|{j: t i ∈ d j} can be used instead.

[0133] The TF-IDF counting method is as follows: TF-IDF=TF*IDF, which is the TF-IDF value corresponding to each segmentation.

[0134] Due to the particularity of the text, there are many numbers, more content and the described content has certain particularity, therefore, the embodiment of the application uses a density-based statistical method to perform clustering analysis on the historical audited text. By dividing the text into texts such as engineering procurement, project acceptance, etc. according to the content, and then extracting rules for each type of document, the accuracy of rule extraction is improved as much as possible.

[0135] Here, a clustering method DBSCAN based on density calculation can be used for clustering, and the main process includes:

[0136] Temporary cluster calculation: convert the TF-IDF values of all word segmentation in each historical audited text into two-dimensional data form of number and weight, as input sample points, and then calculate whether the number of points within a radius R (R is a settable radius value) is greater than inPointsNum (inPointsNum is a settable minimum number of clusters), if yes, it is included in the core point list, and all points meeting the condition are marked as temporary clusters.

[0137] Cluster generation: for the points in each temporary cluster generated above, calculate whether the number of points within a radius R is greater than inPointsNum, if yes, merge the temporary cluster corresponding to the point and the cluster of the current point, that is, a new temporary cluster is obtained.

[0138] Then repeat the above operation until all points in the temporary generated cluster are not in the core point list or the density direct point is in the temporary cluster, then the temporary cluster is a class cluster. Continue to process other temporary clusters in this way until all temporary clusters are divided into class clusters. Then, the historical audited text of the preset category can be selected from the multiple class clusters as a sample legal text.

[0139] Based on any of the above embodiments, Figure 4 The structure diagram of the auditing device provided by the embodiment of the application is shown as Figure 4 The device includes a text determination unit 410, an entity relationship extraction unit 420 and an auditing unit 430.

[0140] The text determination unit 410 is configured to determine the text to be audited.

[0141] The entity relationship extraction unit 420 is configured to perform entity relationship extraction on the text to be audited to obtain the audited entity and the relationship between the audited entities contained in the text to be audited.

[0142] The auditing unit 430 is configured to query the audited entity and the relationship between the audited entities in the auditing rule knowledge base, and determine the auditing result of the text to be audited based on the query result.

[0143] The audit rule knowledge base contains legal entities contained in the sample legal text and the relationship between the legal entities.

[0144] The device provided by the embodiment of the application constructs the audit rule knowledge base based on the legal entities contained in the sample legal text and the relationship between the legal entities, queries the to-be-audited entity and the relationship between the to-be-audited entities in the to-be-audited text in the audit rule knowledge base, and realizes automatic intelligent auditing of the text, greatly reduces the participation of manual work, reduces the auditing cost of personnel, improves the efficiency of text auditing, and improves the accuracy of auditing.

[0145] Based on any of the above embodiments, the entity relationship extraction unit 420 is specifically configured to:

[0146] Based on the feature vector extraction layer in the entity relationship extraction model, the word feature vector of each segmented word in the to-be-audited text is extracted.

[0147] Based on the entity relationship determination layer in the entity relationship extraction model, the to-be-audited entity contained in the to-be-audited text and the relationship between the to-be-audited entities are extracted in combination with the word feature vector of each segmented word in the to-be-audited text.

[0148] The entity relationship extraction model is obtained based on the sample legal text, the legal entities contained in the sample legal text, and the relationship between the legal entities.

[0149] Based on any of the above embodiments, based on the feature vector extraction layer in the entity relationship extraction model, the word feature vector of each segmented word in the to-be-audited text is extracted, specifically including:

[0150] Based on the position of each segmented word in the to-be-audited text in the to-be-audited text, the position encoding of each segmented word in the to-be-audited text is determined.

[0151] Based on the word feature extraction layer in the feature vector extraction layer, in combination with the one-hot encoding of each segmented word in the to-be-audited text, the word feature encoding of each segmented word in the to-be-audited text is extracted.

[0152] The position encoding and the word feature encoding of each segmented word in the to-be-audited text are fused to obtain the word feature vector of each segmented word in the to-be-audited text.

[0153] Based on any of the above embodiments, based on the position of each segmented word in the to-be-audited text in the to-be-audited text, the position encoding of each segmented word in the to-be-audited text is determined, specifically including:

[0154] Based on the position of each segmented word in the to-be-audited text in the to-be-audited text, the feature value of each segmented word in the to-be-audited text is determined.

[0155] If the position of any wordpiece in the text to be audited is an odd number, the feature value of the wordpiece is encoded by using a cosine function to obtain the position encoding of the wordpiece.

[0156] Otherwise, the feature value of the wordpiece is encoded by using a sine function to obtain the position encoding of the wordpiece.

[0157] Based on any of the above embodiments, the apparatus further comprises a pre-training unit configured to, before training the entity relation extraction model:

[0158] obtain a training item of each sample wordpiece in the sample legal text; the training item of any sample wordpiece comprises sample wordpieces within a fixed window before and after the sample wordpiece;

[0159] Based on the one-hot encoding of the training item of each sample wordpiece in the sample legal text, pre-train the word feature extraction layer.

[0160] Based on any of the above embodiments, the apparatus further comprises an updating unit configured to:

[0161] update the dictionary regularly;

[0162] Based on the updated dictionary, obtain the sample legal text;

[0163] Based on the sample legal text, the legal entities contained in the sample legal text and the relations between the legal entities, retrain the entity relation extraction model and update the auditing rule knowledge base.

[0164] Based on any of the above embodiments, obtaining the sample legal text specifically comprises:

[0165] Based on the updated dictionary, perform word segmentation on each historical audited text and count the TF-IDF value of each historical wordpiece in each historical audited text;

[0166] Based on the TF-IDF value of each historical wordpiece in each historical audited text, perform clustering on each historical audited text by using a DBSCAN clustering algorithm to obtain a plurality of class clusters;

[0167] From the plurality of class clusters, filter out historical audited texts of a preset category as the sample legal text.

[0168] Figure 5 An entity structure schematic diagram of an electronic device is shown as follows, Figure 5As shown, the electronic device can include a processor 510, a communications interface 520, a memory 530, and a communications bus 540, wherein the processor 510, the communications interface 520, and the memory 530 complete mutual communication through the communications bus 540. The processor 510 can invoke a logical instruction in the memory 530 to execute an auditing method, which includes determining a text to be audited; performing entity relationship extraction on the text to be audited to obtain an entity to be audited contained in the text to be audited and a relationship between the entities to be audited; querying the entity to be audited and the relationship between the entities to be audited in an auditing rule knowledge base, and determining an auditing result of the text to be audited based on a query result; wherein the auditing rule knowledge base contains a legal entity contained in a sample legal text and a relationship between the legal entities.

[0169] In addition, the logical instruction in the memory 530 described above can be implemented in the form of a software functional unit and sold or used as an independent product, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0170] On the other hand, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer readable storage medium, and the computer program includes program instructions, when the program instructions are executed by a computer, the computer can execute the auditing method provided by the above-mentioned methods, which includes: determining a text to be audited; performing entity relationship extraction on the text to be audited to obtain an entity to be audited contained in the text to be audited and a relationship between the entities to be audited; querying the entity to be audited and the relationship between the entities to be audited in an auditing rule knowledge base, and determining an auditing result of the text to be audited based on a query result; wherein the auditing rule knowledge base contains a legal entity contained in a sample legal text and a relationship between the legal entities.

[0171] In yet another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the above-mentioned auditing method, which comprises: determining a text to be audited; performing entity relation extraction on the text to be audited to obtain entities to be audited contained in the text to be audited and relations between the entities to be audited; querying the entities to be audited and the relations between the entities to be audited in an auditing rule knowledge base, and determining an auditing result of the text to be audited based on a query result; wherein the auditing rule knowledge base contains legal entities contained in a sample legal text and relations between the legal entities.

[0172] The apparatus embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the present embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0173] From the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be realized by means of software and necessary general hardware platform, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of software product, which can be stored in a computer readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, server, or network device, etc.) execute the method described in each embodiment or some parts of the embodiment.

[0174] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. An auditing method, characterized by, The method comprises the steps of: determining a text to be audited; performing entity relationship extraction on the text to be audited based on an entity relationship extraction model to obtain entities to be audited contained in the text to be audited and relationships between the entities to be audited; querying the entities to be audited and the relationships between the entities to be audited in an auditing rule knowledge base, and determining an auditing result of the text to be audited based on a query result; wherein the auditing rule knowledge base contains legal entities contained in sample legal texts and relationships between the legal entities; The method further comprises the steps of: updating a dictionary in a timely manner; obtaining sample legal texts based on the updated dictionary; retraining an entity relationship extraction model based on the sample legal texts, legal entities contained in the sample legal texts, and relationships between the legal entities, and updating the auditing rule knowledge base; The step of obtaining sample legal texts comprises the steps of: performing word segmentation on each historical audited text based on the updated dictionary, and counting a TF-IDF value of each historical segmented word in each historical audited text; performing clustering on each historical audited text based on the TF-IDF value of each historical segmented word in each historical audited text by using a DBSCAN clustering algorithm to obtain a plurality of clusters; selecting historical audited texts of a preset category from the plurality of clusters as the sample legal texts.

2. The auditing method of claim 1, wherein, The step of performing entity relationship extraction on the text to be audited to obtain entities to be audited contained in the text to be audited and relationships between the entities to be audited comprises the steps of: extracting a word feature vector of each segmented word in the text to be audited based on a feature vector extraction layer in the entity relationship extraction model; extracting entities to be audited contained in the text to be audited and relationships between the entities to be audited based on an entity relationship determination layer in the entity relationship extraction model in combination with the word feature vector of each segmented word in the text to be audited; The entity relationship extraction model is trained based on sample legal texts, legal entities contained in the sample legal texts, and relationships between the legal entities.

3. The auditing method of claim 2, wherein, The step of extracting a word feature vector of each segmented word in the text to be audited based on a feature vector extraction layer in the entity relationship extraction model comprises the steps of: determining a position code of each segmented word in the text to be audited based on a position of each segmented word in the text to be audited; extracting a word feature code of each segmented word in the text to be audited based on a word feature extraction layer in the feature vector extraction layer in combination with a one-hot encoding of each segmented word in the text to be audited; fusing the position code and the word feature code of each segmented word in the text to be audited to obtain the word feature vector of each segmented word in the text to be audited.

4. The auditing method of claim 3, wherein, The step of determining a position code of each segmented word in the text to be audited based on a position of each segmented word in the text to be audited comprises the steps of: determining a feature value of each segmented word in the text to be audited based on a position of each segmented word in the text to be audited; If a position of any wordpiece in the text to be audited is an odd position, a feature value of the any wordpiece is encoded by using a cosine function to obtain a position encoding of the any wordpiece. Otherwise, the feature value of the any wordpiece is encoded by using a sine function to obtain the position encoding of the any wordpiece.

5. The auditing method of claim 3, wherein, Before training the entity relation extraction model, the method further comprises: obtaining a training item of each sample wordpiece in a sample legal text; the training item of any sample wordpiece comprises sample wordpieces within a fixed window before and after the any sample wordpiece; pre-training a word feature extraction layer based on one-hot encoding of the training item of each sample wordpiece in the sample legal text.

6. An auditing device, characterized by The method comprises: a text determination unit configured to determine a text to be audited; an entity relation extraction unit configured to perform entity relation extraction on the text to be audited based on an entity relation extraction model to obtain an entity to be audited and a relation between the entities to be audited contained in the text to be audited; an auditing unit configured to query the entity to be audited and the relation between the entities to be audited in an auditing rule knowledge base and determine an auditing result of the text to be audited based on a query result; wherein the auditing rule knowledge base comprises legal entities and relations between the legal entities contained in a sample legal text; the method further comprises an updating unit configured to: update a dictionary regularly; obtain a sample legal text based on the updated dictionary; re-train the entity relation extraction model based on the sample legal text, the legal entities contained in the sample legal text, and the relations between the legal entities, and update the auditing rule knowledge base; the obtaining of the sample legal text specifically comprises: performing word segmentation on each historical audited text based on the updated dictionary and counting a TF-IDF value of each historical wordpiece in each historical audited text; performing clustering on each historical audited text based on the TF-IDF value of each historical wordpiece in each historical audited text by using a DBSCAN clustering algorithm to obtain a plurality of clusters; selecting historical audited texts of a preset category from the plurality of clusters as the sample legal text.

7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the auditing method of any one of claims 1 to 5 when executing the program.

8. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program implements the steps of the auditing method of any one of claims 1 to 5 when executed by the processor.

Citation Information

Patent Citations

  • Entity relationship joint extraction method

    CN110781683A

  • Text processing method, device and equipment, storage medium and program product

    CN112528660A