A contract processing method and apparatus
By using artificial intelligence technology to extract key information and generate processing reports in commercial factoring contract processing, the problem of low efficiency in traditional manual processing has been solved, achieving efficient and accurate contract processing, reducing human risk, and improving user experience.
Patent Information
- Application Number
- CN202411964238.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-12-30
AI Technical Summary
Traditional manual processing of commercial factoring contracts is inefficient and susceptible to human error, failing to meet the rapidly evolving needs of modern commercial factoring.
By employing artificial intelligence technology, the system receives contract processing requests, obtains risk preference indicators, extracts key information from contract documents, calls a pre-trained processing model to generate feedback data, and annotates the contract documents based on the feedback data to generate processing reports and update the statistical data of the processing model to improve processing efficiency and accuracy.
It enables intelligent processing of commercial factoring contracts, improving processing efficiency and accuracy, reducing human risk, minimizing false alarms and omissions, and enhancing user experience.
Smart Images

Figure CN119886054B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to a contract processing method and device. BACKGROUND
[0002] With the rapid development of globalization and information technology, the accuracy and efficiency of commercial factoring contract processing have a crucial impact on the quality and risk management of financial services. The traditional manual processing method is inefficient and easily affected by human factors, and has been unable to meet the rapid development needs of modern commercial factoring business. SUMMARY
[0003] Therefore, the embodiments of the present application provide a contract processing method and device, which can at least realize intelligent processing of commercial factoring contracts, improve processing efficiency, and reduce human risk.
[0004] To achieve the above-mentioned purpose, according to an aspect of an embodiment of the present application, a contract processing method is provided, which includes: receiving a contract processing request, obtaining a corresponding contract risk preference index, and determining a time point for starting a contract processing flow; in response to reaching the time point for starting the contract processing flow, obtaining a contract text, extracting key information in the contract file, and generating feedback data; calling a trained preset processing model, and calculating a processing result according to the feedback data; based on the feedback data, marking in the contract file, and generating a processing report in combination with the processing result; in response to modification information for the marking in the processing report, updating preset statistical data corresponding to each marking, and adjusting the processing model through the statistical data.
[0005] Optionally, obtaining the corresponding contract risk preference index and determining the time point for starting the contract processing flow includes: obtaining the corresponding contract risk preference index, positioning a contract risk preference level according to a contract risk preference level, and matching the time point for starting the contract processing flow.
[0006] Optionally, before extracting the key information in the contract file, it includes: identifying the type of the contract file, calling a preset text type configuration file, and judging whether the type is type information in the text type configuration file; if yes, extracting the key information in the contract text; if not, calling a corresponding conversion model according to the text type configuration file, converting the contract file, and extracting the key information in the converted contract file.
[0007] Optionally, extracting the key information in the contract file includes: calling a recognition engine, performing character recognition on the contract text, generating editable text, and extracting the key information in the editable text.
[0008] Optionally, the key information in the contract file is extracted, including: the contract text is split into independent lexical units by a word segmentation tool, a preset entity recognition model is called to process the lexical units, and key entities and corresponding entity types are determined; and the key entities and the corresponding entity types are taken as the key information.
[0009] Optionally, after determining the key entities and the corresponding entity types, the arrangement position of the key entities in the contract text is located, and the entity types corresponding to the key entities are updated according to a mapping relationship between the arrangement position and the entity types.
[0010] Optionally, after determining the key entities and the corresponding entity types, a preset number of words are extracted from the key entities, and the extracted words and the key entities are taken as to-be-matched words; a preset dictionary is called to query the to-be-matched words, dictionary values corresponding to hit words are obtained, and the dictionary values are updated to the entity types corresponding to the key entities.
[0011] Optionally, the dictionary values are updated to the entity types corresponding to the key entities, including: weights of the hit words are obtained, and a dictionary value corresponding to a hit word with the highest weight is updated to the entity types corresponding to the key entities.
[0012] Optionally, before the feedback data is calculated by calling the trained preset processing model, the contract approval records are preprocessed according to a preset processing pass and processing fail ratio, parameters of the preset processing model are initialized by using random values on a Gaussian distribution, the initialized processing model is trained according to the preprocessed contract approval records, loss results of each contract approval record are calculated based on a preset loss function, all loss results are processed by mean value, and the training is terminated when the mean value processed loss result is less than a preset loss value or the training times exceed a preset number threshold, so as to obtain the trained processing model.
[0013] Optionally, the initialized processing model is trained according to the preprocessed contract approval records, including: the parameters of the processing model are updated by using a gradient descent method.
[0014] Optionally, after the processing report is generated, the processing report is converted into the output format in response to the selected output format.
[0015] Optionally, after the processing report is generated, a modification engine is called to identify a label type, a modification model is matched, feedback information is obtained by executing the modification model, a position of a key entity corresponding to the label is located, and the feedback information is presented.
[0016] Optionally, the method further includes: monitoring an update data amount of the contract processing database; and in response to the update data amount reaching a preset number threshold, starting a processing model training program to obtain training of the processing model on the update data.
[0017] Optionally, the processing result is calculated according to the feedback data, including: calculating a processing value according to the feedback data, calling a preset interval rating model, querying an interval rating corresponding to the processing value, and taking the processing value and the interval rating as the processing result.
[0018] To achieve the above object, according to another aspect of the embodiment of the present application, a contract processing device is provided, comprising: a starting module, configured to receive a contract processing request, acquire a corresponding contract risk preference index, and determine a time point for starting a contract processing flow;
[0019] a feedback data generation module, configured to acquire a contract text in response to reaching the time point for starting the contract processing flow, extract key information in the contract file, and generate feedback data;
[0020] a processing result generation module, configured to call a trained preset processing model and calculate a processing result according to the feedback data;
[0021] a processing report generation module, configured to mark in the contract file based on the feedback data and generate a processing report in combination with the processing result;
[0022] an adjusting module, configured to update preset statistical data corresponding to each mark in response to modification information in the processing report, and adjust the processing model through the statistical data.
[0023] Optionally, the starting module acquires the corresponding contract risk preference index and determines the time point for starting the contract processing flow, including:
[0024] acquiring the corresponding contract risk preference index, positioning a contract risk preference level according to a contract risk preference level, and matching the time point for starting the contract processing flow.
[0025] Optionally, before the feedback data generation module extracts the key information in the contract file, the method comprises: identifying a type of the contract file, calling a preset text type configuration file, judging whether the type is type information in the text type configuration file, extracting the key information in the contract text if yes, and calling a corresponding conversion model according to the text type configuration file to convert the contract file and extract the key information in the converted contract file if no.
[0026] Optionally, the feedback data generation module extracts the key information in the contract file, including: calling a recognition engine to perform character recognition on the contract text, generating editable text, and extracting the key information in the editable text.
[0027] Optionally, the feedback data generation module extracts key information in the contract file, including: splitting the contract text into independent lexical units by a word segmentation tool, calling a preset entity recognition model to process the lexical units, and determining key entities and corresponding entity types; and taking the key entities and the corresponding entity types as the key information.
[0028] Optionally, after the feedback data generation module determines the key entities and the corresponding entity types, the method further includes: positioning the arrangement position of the key entities in the contract text; and updating the entity type corresponding to the key entity according to a mapping relationship between the arrangement position and the entity type.
[0029] Optionally, after the feedback data generation module determines the key entities and the corresponding entity types, the method further includes: extracting a preset number of words from the key entity, taking the extracted words and the key entity as to-be-matched words; calling a preset dictionary to query the to-be-matched words, obtaining a dictionary value corresponding to a hit word, and updating the dictionary value to the entity type corresponding to the key entity.
[0030] Optionally, the feedback data generation module updates the dictionary value to the entity type corresponding to the key entity, including: obtaining the weight of each hit word, and updating the dictionary value corresponding to the hit word with the highest weight to the entity type corresponding to the key entity.
[0031] Optionally, before the processing result generation module calculates the feedback data by calling the trained preset processing model, the method further includes: collecting and preprocessing contract approval records according to a preset processing pass and processing fail ratio; initializing parameters of the preset processing model using random values on a Gaussian distribution, training the initialized processing model according to the preprocessed contract approval records; calculating a loss result of each contract approval record based on a preset loss function, performing mean value processing on all loss results, and terminating the training when the mean value processed loss result is less than a preset loss value or the number of training times exceeds a preset number threshold, to obtain the trained processing model.
[0032] Optionally, the processing result generation module trains the initialized processing model according to the preprocessed contract approval records, including: updating the parameters of the processing model by a gradient descent method.
[0033] Optionally, after the processing report generation module generates the processing report, the method further includes: converting the processing report into the output format in response to the selected output format.
[0034] Optionally, after the processing report generation module generates the processing report, the method further includes: calling a modification engine, identifying a label type, matching a modification model, obtaining a feedback information by executing the modification model, positioning a position of a key entity corresponding to the label, and presenting the feedback information.
[0035] Optionally, the processing result generation module is further configured to: monitor an update data amount of the contract processing database; and in response to the update data amount reaching a preset quantity threshold, start a processing model training procedure to obtain training of the processing model based on the update data.
[0036] Optionally, the processing result generation module calculates the processing result based on the feedback data, including: calculating a processing value based on the feedback data; calling a preset interval rating model to query an interval rating corresponding to the processing value; and taking the processing value and the interval rating as the processing result.
[0037] To achieve the above object, according to a further aspect of an embodiment of the present application, there is provided a contract processing electronic device.
[0038] The electronic device of the embodiment of the present application includes: one or more processors; and a storage device configured to store one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement any of the above-mentioned contract processing methods.
[0039] To achieve the above object, according to a further aspect of an embodiment of the present application, there is provided a computer readable medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-mentioned contract processing methods.
[0040] To achieve the above object, according to a further aspect of an embodiment of the present application, there is provided a computer program product. The computer program product of the embodiment of the present application includes a computer program, which, when executed by a processor, implements the contract processing method provided by the embodiment of the present application.
[0041] According to the scheme provided by the present application, one embodiment of the above-mentioned application has the following advantages or beneficial effects: the technical problems of poor adaptability, i.e., the existing rule or template matching-based system is difficult to adapt to the changes and diversity of contract texts; the technical problem of low accuracy, i.e., the rule or template matching-based system is prone to false positives or false negatives for complex contract texts; and the technical problem of limited overall processing efficiency due to the need for a large amount of manual preprocessing and post-processing work, such as contract scanning and text alignment, are solved. Thus, the present application exhibits significant advantages in the field of factoring contract processing, not only improving processing efficiency and accuracy, but also reducing human risk and improving user experience.
[0042] The further effects of the above-mentioned non-conventional optional mode will be described in the following with reference to the specific embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0043] The accompanying drawings are used to better understand the present application and do not constitute an improper limitation on the present application. Among them:
[0044] Figure 1 is a main flowchart of a contract processing method according to an embodiment of the present application;
[0045] Figure 2 is a left-right structure diagram of optional key information according to an embodiment of the present application;
[0046] Figure 3 is an up-down structure diagram of optional key information according to an embodiment of the present application;
[0047] Figure 4 is a training flowchart of a processing model according to an embodiment of the present application;
[0048] Figure 5 is a diagram of optional contract file labeling according to an embodiment of the present application;
[0049] Figure 6 is a diagram of optional automatic modification of key information according to an embodiment of the present application;
[0050] Figure 7 is a main flowchart of another contract processing method according to an embodiment of the present application;
[0051] Figure 8 is a main module diagram of a contract processing apparatus according to an embodiment of the present application;
[0052] Figure 9 is an exemplary system architecture diagram to which embodiments of the present application can be applied;
[0053] Figure 10 is a structural diagram of a computer system of a mobile device or server suitable for implementing embodiments of the present application. DETAILED DESCRIPTION
[0054] Exemplary embodiments of the present application will be described hereinafter with reference to the accompanying drawings, in which various specific details are set forth in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one of ordinary skill in the art that the embodiments of the present application can be practiced without these specific details. In other instances, well-known structures and functions have not been described in detail in order to avoid obscuring the embodiments of the present application. The following description is not meant to limit the present application to the embodiments described herein.
[0055] It should be noted that in the embodiments of the present application, some software, components, models, etc. of the prior art can be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the technical solutions of the present application, but it does not mean that the applicant has or will necessarily use the scheme.
[0056] Where there is no conflict, the embodiments and features in the embodiments of this invention can be combined with each other. The acquisition, transmission, storage, use, and processing of data in the technical solutions of this invention comply with the relevant provisions of national laws and regulations, are used for legal and reasonable purposes, and are not shared, disclosed, or sold outside of these legal uses, and are subject to supervision and management by regulatory authorities.
[0057] Regarding user information, necessary measures should be taken to prevent unauthorized access to such personal information data, ensure that personnel authorized to access such data comply with relevant laws and regulations, and safeguard the security of user personal information. Once this user personal information data is no longer needed, risks should be minimized by restricting or even prohibiting data collection and / or deleting the data. Where applicable, including in certain relevant applications, user privacy should be protected through data de-identification, such as by removing specific identifiers (e.g., date of birth), controlling the amount or specificity of stored data (e.g., collecting location data at the city level rather than the specific address level), controlling how data is stored, and / or other de-identification methods.
[0058] See Figure 1 The diagram shows the main flowchart of a contract processing method provided by an embodiment of the present invention, which includes the following steps:
[0059] S101: Receive contract processing request, obtain the corresponding contract risk preference index, and determine the time point to start the contract processing process.
[0060] S102: In response to the time point when the contract processing flow is initiated, obtain the contract text, extract key information from the contract file, and generate feedback data.
[0061] S103: Call the pre-trained processing model and calculate the processing result based on the feedback data.
[0062] S104: Based on the feedback data, make annotations in the contract documents and generate a processing report based on the processing results.
[0063] S105: In response to the modification information marked in the processing report, update the preset statistical data corresponding to each mark, and adjust the processing model based on the statistical data.
[0064] In the above embodiments, the present invention utilizes artificial intelligence technology to adaptively initiate the contract processing process at different times based on different contract risk preferences. It generates feedback data and calls the processing model to calculate the processing results based on key information in the contract text. The feedback data and processing results marked in the contract file are used to form a processing report. At the same time, it can update statistical data in response to changes in information to adjust the processing model.
[0065] In a further embodiment, for step S101, the corresponding contract risk preference index is obtained, and the time point for starting the contract processing flow is determined, so that the application can select different contract processing flow execution time points according to the risk preference, and realize the technical effect of using the system to assist in approval or automatic approval for compliance judgment results. Further embodiments can obtain the corresponding contract risk preference index, locate the contract risk preference level according to the contract risk preference level, and match the time point for starting the contract processing flow.
[0066] For example, if the contract risk preference level is located according to the contract risk preference level, it is mainly suitable for risk preference conservative cases (i.e. the contract processing flow of the application is used as an auxiliary approval function), and the contract processing flow of the application is started before the existing contract processing flow is initiated or in the approval process. The compliance judgment result can be verified, and the additional approval process is selected according to the verification result (for example, the contract processing flow of the application predicts an error). Of course, the contract processing flow can also be terminated directly (for example, the contract processing flow of the application predicts correctly). Another example: if the contract risk preference level is located according to the contract risk preference level, it is mainly suitable for risk preference aggressive cases (i.e. the contract processing flow of the application is used as a system automatic approval function), which can directly replace the existing approval process of the system, start the contract processing flow of the application to obtain the prediction result, and automatically reply. It should be noted that in order to prevent malicious use of loopholes, a preset proportion of business sampling can be configured. If there is any doubt about the automatic approval result, the existing approval process of the system can be converted for further consideration. Of course, the results of the existing approval can also be collected for updating the processing model of the application.
[0067] In a further embodiment, for step S102, before extracting the key information in the contract file, the following steps are included: identifying the type of the contract file, calling a preset text type configuration file, and determining whether the type is the type information in the text type configuration file. According to the determination result, if yes, the key information in the contract text is extracted, and if no, the corresponding conversion model is called according to the text type configuration file to convert the contract file, and the key information in the converted contract file is extracted. For example, the type of the contract file is identified as an electronic contract file, the text type configuration file is called, and the type information exists, so the string text can be directly extracted. Another example: the type of the contract file is identified as a scanned contract file, the text type configuration file is called, and the type information does not exist, so the scanned contract file is converted into a standard electronic file through the corresponding conversion model, such as denoising, binarization, rotation correction and other processing operations on the image.
[0068] Some embodiments, for extracting the key information in the contract file in step S102, can include calling a recognition engine, performing optical character recognition (OCR) on the contract text to generate editable text, and extracting the key information in the editable text. For example, calling a high-precision OCR engine Tesseract to perform optical character recognition on the image to convert the recognized text into editable TXT format. It should be noted that the OCR recognition result can be quality checked, possible errors can be recognized and corrected, and irrelevant information such as headers, footers, watermarks, etc. in the text can be removed before extracting the key information in the contract file, i.e. text cleaning is implemented. Thus, through this embodiment, the paper contract can be accurately converted into editable text, avoiding errors in the manual input process.
[0069] Some embodiments, for extracting the key information in the contract file in step S102, can include: splitting the contract text into independent lexical units by a word segmentation tool, calling a preset entity recognition model to process the lexical units, determining the key entity and the corresponding entity type, and taking the key entity and the corresponding entity type as the key information. For example, using a word segmentation tool (such as jieba segmentation, HanLP segmentation, Jcseg segmentation, etc.) to split the contract text into independent lexical units, such as "name", "$1000", etc. Applying an entity recognition model (such as a BiLSTM-CRF model based on deep learning, a convolutional neural network CNN, a recurrent neural network RNN, etc.) to identify the key entity in the contract, such as: entity types are "name", "certificate number", "amount", "term", "interest rate".
[0070] It should be noted that after splitting the contract text into independent lexical units by the word segmentation tool, stop words and punctuation marks can be removed, for example: by calling a stop word list or by calling a regular expression, common stop words (such as "of", "is", etc.) and punctuation marks in the text are removed.
[0071] In preferred embodiments, the present application considers that an entity can be Party A in contract A and Party B in contract B, and after determining the key entity and the corresponding entity type, more accurate entity classification can be achieved by the arrangement of the key entity in the contract text or by reclassification.
[0072] For example: positioning the arrangement position of the key entity in the contract text, updating the entity type corresponding to the key entity according to the mapping relationship between the arrangement position and the entity type. For example: in the contract text, the information of Party A and Party B is usually displayed in blocks, and there is a left-right structure (such asFigure 2 ) are grouped according to structural features, if the same defined words are continuously present, the data are grouped at an interval of one, and then it is judged whether the characters of "Party A" and "Party B" are present in the data to complete positioning and update the entity type, for example, "certificate number" is updated to "Party A certificate number"; there are also upper and lower structures (such as Figure 3 ), if the same defined words are present at an interval of multiple and the interval distance is the same, the data are grouped according to the continuously present data until the next same character is encountered, ending this group of grouping, and then it is judged whether the characters of "Party A" and "Party B" are present in the data to complete positioning and update the entity type, for example, "certificate number" is updated to "Party A certificate number".
[0073] Further, more accurate entity classification is realized through reclassification: a preset number of words are extracted from the front of the key entity, the extracted words and the key entity are taken as to-be-matched words, then a preset dictionary is called to query the to-be-matched words, dictionary values corresponding to the hit words are obtained, and the dictionary values are updated to the entity type corresponding to the key entity. Preferably, the weight of each hit word is obtained, and the dictionary value corresponding to the hit word with the highest weight is updated to the entity type corresponding to the key entity. For example: the identified name, certificate number and other data are classified again, 5 words are extracted from the front of the key entity, the extracted 5 words and the key entity are taken as to-be-matched words, a preset dictionary is called for tail-end matching, and a weight method (such as the hit priority in Table 1) is used, that is, the field with a higher weight is preferentially hit.
[0074] Table 1
[0075]
[0076] It can be seen that the above various embodiments of the present application can deeply understand the contract content, accurately extract key information, and provide the most accurate data preparation for subsequent intelligent compliance prediction, thereby reducing the false positives and false negatives.
[0077] In a further embodiment, for step S103, before the feedback data is calculated by calling the trained preset processing model, the preset processing model can be trained, as shown in Figure 4 , including:
[0078] S401: According to the preset processing pass and processing fail ratio, contract approval records are collected and preprocessed. For example: the following 30000 samples are selected as a sample set, as shown in Table 2:
[0079] Table 2
[0080] Approval Disapproval Last year approval record 8000 8000 Last two years approval record 5000 5000 Last three years approval record 2000 2000
[0081] Among them, randomly extract 2000 training pass samples and 2000 training not pass samples as test data set (not participate in model training, only as the final correct rate verification), the remaining 26000 data as training set.
[0082] It should be noted that in order to have better processing model training accuracy and speed, the sample data collected can be preprocessed, such as unit conversion, normalization and the like: contract amount: according to the unit of ten thousand yuan to convert into the corresponding numerical value, contract period: according to the unit of days to convert into the corresponding numerical value, contract interest rate: according to the unit of BP number (0.01% or 0.00001) to convert into the corresponding numerical value.
[0083] S402: initialize the parameters of the preset processing model with random values on Gaussian distribution, and train the initialized processing model according to the preprocessed contract approval records. Example: processing model:
[0084]
[0085] Among them, x is the key entity corresponding to the entity type in the feedback data, for example, x0 can be contract amount, x1 can be contract period, x2 can be contract interest rate, θ0, θ1, θ2 are parameters trained by machine learning. For example: initialize θ0, θ1, θ2 parameters with random values on Gaussian distribution N(0,1). Preferably, the parameters of the processing model are updated by gradient descent method. Example: update θ0, θ1, θ2 parameters by gradient descent method during training, and the update formula is θ n ′=θ n -k·dθ n , where k represents the learning rate, preferably selected as 0.003, dθ n is the derivative of θ n on J(L‘), which can be derived as And the training number K=K+1.
[0086] S403: calculate the loss result of each contract approval record based on the preset loss function, and perform mean value processing on all loss results.
[0087] Example: 26000 training set samples are substituted into the processing model
[0088]
[0089] Calculate, each sample gets a result value h', which represents the prediction result of the current model for this sample. For each sample, the result value h' and the true value h (for example, 1 pass, 0 not pass) of the sample itself are brought into the loss function:
[0090] L(h', h) = -(h log h' + (1 - h) log (1 - h'))
[0091] The loss result L' of a single sample is calculated, and the loss results L' of all samples are averaged:
[0092]
[0093] The smaller the result is, the higher the model accuracy is. The loss value J of the system optimal record (the weight value and loss value of the current optimal solution) is compared. If J is empty or J(L') < J, the system optimal record is updated.
[0094] S404: If the loss result after averaging is less than a preset loss value or the number of training exceeds a preset number threshold, the training is terminated, and a trained processing model is obtained.
[0095] For example, if the number of training K exceeds the preset number threshold 50000, the training is forcibly terminated. If the loss value J of the system optimal record is greater than the preset loss value 0.00001, step 403 is repeated. If the loss value is less than the preset loss value 0.00001, the training is terminated.
[0096] It is worth noting that the verification set sample can be brought into the processing model The calculation is performed, and the accuracy is calculated by comparing with the true value.
[0097] In addition, it is worth noting that the processing result calculated according to the feedback data in step S103 can include: calculating a processing value according to the feedback data, calling a preset interval rating model, querying an interval rating corresponding to the processing value, and taking the processing value and the interval rating as the processing result. For example, the feedback data (such as contract amount, contract period, and contract interest rate) is substituted into the trained processing model for calculation, and the processing value according to the calculation result is judged. If the processing value corresponds to the interval of 0.5-1, it is passed. If the processing value corresponds to the interval of 0.1-0.5, it is not passed.
[0098] In a further embodiment, after the processing report is generated in step S104, the processing report can be converted into the output format in response to the selected output format. For example, structured output in JSON and XML formats is supported.
[0099] It is worth noting that the annotation information in the contract file to generate the processing report in step S104 can include a label array: labelkey (unique identification of the label), labelName (label name), labelValue (label value, used for the architecture of the user system), and labelDesc (label description, used for display), such asFigure 5 As shown.
[0100] In a preferred embodiment, the key entity can be automatically modified, and the modification engine is called, the annotation type is identified (for example, by identifying the annotation type through the label name), the modification model is matched (for example, if the label name is a counterparty, the counterparty information can be matched from the database), the reverse information is obtained by executing the modification model, the position of the annotation corresponding to the key entity is located, and the reverse information is presented. For example: the matched counterparty can be automatically filled in directly, saving the time of manual filling by the handling personnel, and of course, the handling personnel is allowed to adjust the reverse information and provide error feedback to improve the extraction accuracy, such as Figure 6 As shown.
[0101] In a further embodiment, for step S105, further comprising: monitoring the update data amount of the contract processing database; and in response to the update data amount reaching a preset quantity threshold, starting a processing model training program to obtain training of the processing model based on the update data.
[0102] In a further embodiment, for step S105, in response to the modification information for the annotations in the processing report, updating the preset statistical data corresponding to each annotation, and adjusting the processing model based on the statistical data, for example: the user provides feedback according to the system set format, i.e. structured modification information feedback, for example: data error matching (the label name and the label content are mismatched, such as the information of Party A is filled in the label of Party B), data recognition error (the content extraction of the label is incorrect, such as missing words), compliance judgment error (the system prediction of compliance judgment is incorrect, which needs to be fed back by multiple levels of approval), and then updating the statistical data, for example: real-time monitoring and updating the statistical data of the annotation performance indicators (annotation error number, annotation error ratio, etc.), and when the statistical data meets the preset conditions, the program for adjusting the processing model is started (for example: when the system error number is greater than the preset number threshold, an alarm is given and the program for adjusting the processing model is started).
[0103] Therefore, by collecting and analyzing new contract data and user feedback, the machine learning model can be automatically updated and optimized, the adaptability and accuracy thereof are improved, and the steps and parameter settings of the automatic process are continuously optimized according to the actual application situation and user feedback, so that the accuracy monitoring and performance monitoring are realized, and the overall processing efficiency and user experience are improved.
[0104] The method provided by each of the above embodiments realizes intelligent processing of a factoring contract, integrates each link into an automatic tool chain, and realizes end-to-end automatic processing of a paper contract to a processing result. The automatic processing flow reduces the opportunity for manual intervention and reduces the risk caused by human negligence, fatigue, or subjective judgment. The machine learning model is trained based on a large amount of data and can objectively and fairly evaluate the compliance of the contract, reducing human bias and errors. In addition, the present application establishes an exception handling and user feedback mechanism in the automatic process, captures and processes exceptions in a timely manner, and continuously optimizes the process performance. At the same time, based on the extracted contract element information, the machine learning model is used for intelligent compliance prediction to determine whether the contract meets the approval requirements, realizing intelligent compliance prediction. In addition, as new contract formats, clauses and regulations appear, the system can update the training data and model parameters to maintain its adaptability and accuracy, and better adapt to the changes and diversity of contract texts.
[0105] Referring to Figure 7 , an optional contract processing method flowchart according to an embodiment of the present application is shown, comprising the following steps:
[0106] S701: receiving a contract processing request and obtaining a corresponding contract risk preference index.
[0107] S702: positioning the contract risk preference level according to the contract risk preference level, and matching the time point of starting the contract processing flow.
[0108] S703: in response to reaching the time point of starting the contract processing flow, obtaining the contract text and identifying the type of the contract file.
[0109] S704: calling a preset text type configuration file, determining whether the type is the type information in the text type configuration file, if yes, executing step S706, if not, executing step S705 and then executing step S706.
[0110] S705: converting the contract file according to the corresponding conversion model in the text type configuration file.
[0111] S706: calling a recognition engine to perform character recognition on the contract text to generate editable text.
[0112] S707: splitting the contract text into independent lexical units by a word segmentation tool, calling a preset entity recognition model to process the lexical units, determining key entities and corresponding entity types, taking the key entities and corresponding entity types as key information, and generating feedback data.
[0113] Further, the key information can be updated based on the arrangement or reclassification. For example, the arrangement position of the key entity in the contract text is located, and the entity type corresponding to the key entity is updated according to the mapping relationship between the arrangement position and the entity type. Or for example, a preset number of words are extracted from the key entity, the extracted words and the key entity are taken as matching words, and then a preset dictionary is called to query the matching words to obtain the dictionary value corresponding to the hit words. The dictionary value is updated to the entity type corresponding to the key entity.
[0114] S708: A trained preset processing model is called to calculate a processing result according to the feedback data.
[0115] Further, a processing value is calculated according to the feedback data, a preset interval rating model is called to query the interval rating corresponding to the processing value, and the processing value and the interval rating are taken as the processing result.
[0116] S709: Based on the feedback data, labeling is performed in the contract file, and a processing report is generated in combination with the processing result.
[0117] Further, the processing report can be converted into the output format in response to the selected output format.
[0118] S710: A modification engine is called to identify the labeling type, match a modification model, obtain the modification information by executing the modification model, locate the position of the key entity corresponding to the labeling, and present the modification information.
[0119] S711: In response to the modification information for the labeling in the processing report, the preset statistical data corresponding to each labeling is updated, and the processing model is adjusted through the statistical data.
[0120] In addition, the update data amount of the contract processing database can be monitored, and in response to the update data amount reaching a preset number threshold, a processing model training program is started to obtain the update data for processing model training.
[0121] The method provided by the above embodiment greatly reduces the time and labor cost required for manual processing, reduces the delay and error caused by human factors, improves the overall efficiency of the processing work, and makes the entire processing process more efficient and fast. The quality check and feedback processing, abnormal mechanism in the automatic process can timely discover and correct the recognition error and abnormal situation, further improve the accuracy of the processing, and meet the actual needs of the user. The generated processing report is detailed and intuitive, which is convenient for the processing personnel to quickly understand the contract content and the processing result. Moreover, the present application has strong expansibility and flexibility, and can be continuously optimized and upgraded with the progress of technology and changes in business needs. At the same time, the process monitoring and optimization mechanism ensures the stability and reliability of the system, and improves the overall operation efficiency.
[0122] Referring to Figure 8 , a main module schematic diagram of a contract processing device 800 provided by an embodiment of the present application is shown, which comprises:
[0123] The starting module 801 is configured to receive a contract processing request, obtain a corresponding contract risk preference index, and determine a time point for starting a contract processing flow.
[0124] The feedback data generation module 802 is configured to, in response to reaching the time point for starting the contract processing flow, obtain a contract text, extract key information in the contract file, and generate feedback data.
[0125] The processing result generation module 803 is configured to call a trained preset processing model and calculate a processing result according to the feedback data.
[0126] The processing report generation module 804 is configured to mark in the contract file based on the feedback data and generate a processing report in combination with the processing result.
[0127] The adjusting module 805 is configured to, in response to modification information for the marking in the processing report, update preset statistical data corresponding to each marking and adjust the processing model through the statistical data.
[0128] In the device, the starting module 801 can also be configured to obtain a corresponding contract risk preference index, locate a contract risk preference level according to a contract risk preference level, and match a time point for starting a contract processing flow.
[0129] In the device, the feedback data generation module 802 can also be configured to:
[0130] identify a type of the contract file, call a preset text type configuration file, determine whether the type is type information in the text type configuration file, extract key information in the contract text if the type is the type information, and convert the contract file according to a corresponding conversion model in the text type configuration file and extract key information in the converted contract file if the type is not the type information.
[0131] In the device, the feedback data generation module 802 can also be configured to call a recognition engine, perform character recognition on the contract text, generate editable text, and extract key information in the editable text.
[0132] In the device, the feedback data generation module 802 can also be configured to split the contract text into independent lexical units through a word segmentation tool, call a preset entity recognition model to process the lexical units, determine key entities and corresponding entity types, and take the key entities and the corresponding entity types as the key information.
[0133] In the embodiment of the present application, the feedback data generation module 802 can also be configured to: locate the arrangement position of the key entity in the contract text; and update the entity type corresponding to the key entity according to a mapping relationship between the arrangement position and the entity type.
[0134] In the embodiment of the present application, the feedback data generation module 802 can also be configured to: extract a preset number of words from the key entity, and take the extracted words and the key entity as to-be-matched words; query the to-be-matched words by calling a preset dictionary, obtain a dictionary value corresponding to a hit word, and update the dictionary value to the entity type corresponding to the key entity.
[0135] In the embodiment of the present application, the feedback data generation module 802 can also be configured to: obtain the weight of each hit word, and update the dictionary value corresponding to the hit word with the highest weight to the entity type corresponding to the key entity.
[0136] In the embodiment of the present application, the processing result generation module 803 can also be configured to: collect and preprocess the contract approval records according to a preset processing pass and processing fail ratio; initialize the parameters of a preset processing model by using a random value on a Gaussian distribution, train the initialized processing model according to the preprocessed contract approval records, and obtain a trained processing model.
[0137] In the embodiment of the present application, the processing result generation module 803 can also be configured to: update the parameters of the processing model by using a gradient descent method.
[0138] In the embodiment of the present application, the processing report generation module 804 can also be configured to: convert the processing report into the output format in response to the selected output format.
[0139] In the embodiment of the present application, the processing report generation module 804 can also be configured to: call a modification engine, identify a label type, match a modification model, obtain a reverse display information by executing the modification model, locate the position of the key entity corresponding to the label, and present the reverse display information.
[0140] In the embodiment of the present application, the processing result generation module 803 can also be configured to: monitor the update data amount of the contract processing database; and start a processing model training program to obtain the update data for processing model training in response to the update data amount reaching a preset number threshold.
[0141] The processing result generation module 803 can also be configured to: calculate a processing value according to the feedback data, call a preset interval rating model, query an interval rating corresponding to the processing value, and take the processing value and the interval rating as the processing result.
[0142] In addition, the specific implementation of the device in the embodiments of the present application has been described in detail in the above method, and therefore the repeated content will not be described here.
[0143] Figure 9 An exemplary system architecture 900 to which embodiments of the application can be applied is shown, including terminal devices 901, 902, 903, a network 904, and a server 905 (only examples).
[0144] The terminal devices 901, 902, 903 can be various electronic devices with a display screen and supporting web browsing, installed with various communication client applications, and the user can use the terminal devices 901, 902, 903 to interact with the server 905 through the network 904 to receive or send messages, etc.
[0145] The network 904 is a medium for providing a communication link between the terminal devices 901, 902, 903 and the server 905. The network 904 can include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0146] The server 905 can be a server providing various services, such as a background management server supporting a shopping website browsed by the user using the terminal devices 501, 502, 503 (only an example). The background management server can analyze and process the received product information query request and other data, and feed back the processing result (such as target push information, product information - only examples) to the terminal device. It should be noted that the method provided by the embodiments of the present application is generally executed by the server 905, and accordingly, the device is generally provided in the server 905.
[0147] It should be understood that Figure 9 The number of terminal devices, networks, and servers in the above system architecture is only illustrative. According to the implementation needs, there can be any number of terminal devices, networks, and servers.
[0148] Reference is made below to Figure 10 which shows a structural schematic diagram of a computer system 1000 of a terminal device suitable for implementing the embodiments of the present application. Figure 10 The terminal device shown is only an example, and should not impose any limitation on the functions and use range of the embodiments of the present application.
[0149] As Figure 10As shown, the computer system 1000 includes a central processing unit (CPU) 1001 which can perform various appropriate actions and processes in accordance with a program stored in a read only memory (ROM) 1002 or a program loaded from the storage section 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the system 1000 are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0150] Connected to the I / O interface 1005 are an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as necessary. A removable recording medium 1011 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 1010 as necessary, so that a computer program read therefrom is installed into the storage section 1008 as necessary.
[0151] In particular, the processes described above with reference to the flow charts can be implemented as a computer software program in accordance with the embodiments of the present disclosure. For example, the embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods shown in the flow charts. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 1009, and / or installed from the removable recording medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, the above-described functions defined in the system of the present disclosure are executed.
[0152] It should be noted that the computer-readable medium shown in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component. In the present application, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or component. The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0153] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment or a part of code containing one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different order than that shown in the drawings. For example, two blocks that are shown in succession can actually be executed substantially in parallel, and sometimes in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams or flowcharts, and the combination of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0154] The modules described in the embodiments of the present application can be implemented in the form of software or in the form of hardware. The modules described can also be arranged in a processor, for example, a processor can be described as including a step extraction module, a task workflow generation module, and a scene workflow generation module. In some cases, the names of these modules do not constitute a limitation on the modules themselves, for example, the scene workflow generation module can also be described as an "operation and maintenance scene workflow generation module".
[0155] As another aspect, the present application also provides a computer readable medium, which can be included in the device described in the above embodiments, or can exist independently without being assembled into the device. The computer readable medium carries one or more programs, which, when executed by the device, cause the device to perform any of the above-described contract processing methods.
[0156] The computer program product of the present application includes a computer program, which, when executed by a processor, implements the contract processing method in the embodiments of the present application.
[0157] The above detailed description does not constitute a limitation on the scope of protection of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A contract processing method characterized by, The method comprises the following steps: receiving a contract processing request, obtaining a corresponding contract risk preference index, and determining a time point for starting a contract processing flow; in response to reaching the time point for starting the contract processing flow, obtaining a contract text, extracting key information in the contract file, and generating feedback data; wherein the key information includes key entities and corresponding entity types, and the arrangement position of the key entities in the contract text is located, and the entity types corresponding to the key entities are updated according to the mapping relationship between the arrangement position and the entity types; calling a trained preset processing model to calculate a processing result according to the feedback data; based on the feedback data, labeling in the contract file, and generating a processing report combined with the processing result; in response to modification information for the labeling in the processing report, updating preset statistical data corresponding to each labeling, and adjusting the processing model through the statistical data; before calling the trained preset processing model, comprising: collecting contract approval records and preprocessing according to the preset processing pass and processing fail ratio; initializing the parameters of the preset processing model using random values on a Gaussian distribution, training the initialized processing model according to the preprocessed contract approval records; calculating the loss result of each contract approval record based on the preset loss function, and performing mean value processing on all loss results; when the mean value processing loss result is less than the preset loss value or the training times exceed the preset number threshold, the training is terminated, and the trained processing model is obtained.
2. The method of claim 1, wherein, obtaining a corresponding contract risk preference index and determining a time point for starting a contract processing flow, comprising: obtaining a corresponding contract risk preference index, positioning a contract risk preference level according to a contract risk preference level, and matching a time point for starting a contract processing flow.
3. The method of claim 1, wherein, before extracting key information in the contract file, comprising: identifying the type of the contract file, calling a preset text type configuration file, and determining whether the type is type information in the text type configuration file; if yes, extract the key information in the contract text; if not, according to the text type configuration file, call the corresponding conversion model to convert the contract file, and extract the key information in the converted contract file.
4. The method of claim 1, wherein, extracting key information in the contract file, comprising: calling a recognition engine to perform character recognition on the contract text to generate editable text, and extracting key information from the editable text.
5. The method according to any one of claims 1 to 4, characterized in that, extracting key information in the contract file, comprising: splitting the contract text into independent word units through a word segmentation tool, calling a preset entity recognition model to process the word units, determining key entities and corresponding entity types; the key entities and the corresponding entity types are used as key information.
6. The method of claim 5, wherein, after determining the key entities and the corresponding entity types, comprising: extracting a preset number of words from the key entities, and extracting the key entities and the extracted words as matching words; calling a preset dictionary to query the matching words to obtain a dictionary value corresponding to the hit words, and updating the dictionary value to the entity type corresponding to the key entities.
7. The method of claim 6, wherein, updating the dictionary value to the entity type corresponding to the key entities, comprising: The weight of each hit word segmentation is obtained, and the dictionary value corresponding to the hit word segmentation with the highest weight is updated to the entity type corresponding to the key entity.
8. The method of claim 1, wherein, According to the preprocessed contract approval records, the initialized processing model is trained, including: The parameters of the processing model are updated by the gradient descent method.
9. The method of claim 1, wherein, After generating the processing report, including: In response to the selected output format, the processing report is converted into the output format.
10. The method of claim 1, wherein, After generating the processing report, including: The modification engine is called to identify the annotation type, match the modification model, and obtain the anti-exposure information by executing the modification model; The position of the key entity corresponding to the annotation is located, and the anti-exposure information is presented.
11. The method of claim 1, wherein, Also including: Monitoring the update data volume of the contract processing database; In response to the update data volume reaching a preset number threshold, starting the processing model training program to obtain the update data for processing model training.
12. The method of claim 1, wherein, According to the feedback data, the processing result is calculated, including: According to the feedback data, the processing value is calculated, the preset interval rating model is called, the interval rating corresponding to the processing value is queried, and the processing value and the interval rating are taken as the processing result.
13. A contract processing apparatus characterized by comprising: Including: A starting module for receiving a contract processing request, obtaining a corresponding contract risk preference index, and determining a time point for starting a contract processing process; A feedback data generation module for obtaining a contract text and extracting key information in the contract file in response to reaching the time point for starting the contract processing process, and generating feedback data; wherein the key information includes key entities and corresponding entity types, and the arrangement position of the key entities in the contract text, and the entity types are updated according to the mapping relationship between the arrangement position and the entity types; A processing result generation module for calling a trained preset processing model to calculate a processing result according to the feedback data; before calling the trained preset processing model, including: collecting contract approval records and preprocessing according to a preset processing pass and processing fail ratio; initializing the parameters of the preset processing model using random values on a Gaussian distribution, training the initialized processing model according to the preprocessed contract approval records; calculating the loss result of each contract approval record based on a preset loss function, and performing mean value processing on all loss results; terminating the training when the mean value processed loss result is less than a preset loss value or the training number exceeds a preset number threshold, and obtaining a trained processing model; A processing report generation module for annotating in a contract file based on feedback data, and generating a processing report in combination with the processing result; An adjustment module for updating preset statistical data corresponding to each annotation in response to modification information for the annotations in the processing report, and adjusting the processing model through the statistical data.
14. An electronic device, comprising: One or more processors; Storage devices for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1-12. The program is executed by the processor to implement the method of any one of claims 1-12.
15. A computer readable medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the method of any one of claims 1-12.
16. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the method of any one of claims 1-12.
Citation Information
Patent Citations
Contract auditing method and device
CN110705952A
Enterprise legal process auxiliary decision-making system and method based on artificial intelligence
CN111144087A