Method for automatically generating lawyer collection function based on artificial intelligence model
Through the legal knowledge base and natural language processing technology based on artificial intelligence model, combined with MAML meta-learning algorithm and BERT model, a personalized collection lawyer letter is generated, which solves the problem of lack of personalization and flexibility in collection lawyer letters in the existing technology. Improves the operation efficiency and compliance of the law firm.
Patent Information
- Application Number
- CN202411148260.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing computer-generated collection lawyer letters lack personalization and flexibility, cannot be adjusted according to specific circumstances, and require frequent modification, resulting in low operation efficiency of the law firm and high labor costs.
Using an artificial intelligence model-based method, a legal knowledge base is established by collecting and processing legal documents, and a training model is extracted from historical collection lawyer letters using natural language processing technology, generating collection lawyer letters that meet legal requirements, and embedding them. The MAML meta-learning algorithm adapts the model to changes in the legal environment, and combines the BERT model to improve the accuracy and compliance of generated text.
The personalized generation of collection lawyer letters has been realized, the manpower and material consumption has been reduced, the law firm operation efficiency has been improved, the accuracy and compliance of collection documents have been ensured, and the cost of review and adjustment of the system model has been reduced.
Smart Images

Figure CN119128055A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of legal text processing, and in particular to a method for automatically generating a collection lawyer's letter based on an artificial intelligence model, which aims to improve collection efficiency, standardize collection behavior, and ensure the legality of the collection process. Background Art
[0002] In the fields of financial lending, commercial transactions, etc., overdue debts are a common problem. Traditional collection methods usually rely on manually written lawyers' letters, which is time-consuming and labor-intensive, and prone to legal omissions. With the rapid development and application of computer technology, especially artificial intelligence technology, the previously boring and stereotyped paperwork such as collection lawyers' letters has gradually been assisted by computer technology. However, the existing collection lawyers' letters generated by computer technology lack personalization, and the lawyers' letters generated by templates often lack pertinence and cannot be personalized and adjusted according to specific circumstances; they lack flexibility, and the templates are fixed and cannot be flexibly adjusted according to specific changes in the case. In actual operations, templates need to be frequently modified to adapt to different cases, and each modification requires professional lawyers to intervene and review; they lack interactivity, and require professionals to answer questions online in real time, which cannot meet customer inquiries in a timely manner, and the labor cost of online Q&A services is high.
[0003] The above-mentioned record of background technical knowledge is intended to help ordinary technicians in this field understand the existing technologies that are relatively close to the present invention, and at the same time facilitate the understanding of the inventive concept and technical solution of the present invention. It should be clear that in the absence of clear evidence that the above-mentioned content has been disclosed before the filing date of this patent application, the above-mentioned background technology should not be used to evaluate the novelty of the technical solution of this application. Summary of the invention
[0004] Technical issues In order to solve the above problems, the purpose of the present invention is to provide a method for automatically generating collection lawyer letters based on an artificial intelligence model, so as to reduce the consumption of manpower and material resources and improve the operating efficiency of law firms. The method can quickly adapt to the new legal environment and use historical collection lawyer letters to participate in training, which greatly saves the review and adjustment costs of the system model. The writing style, word order context, etc. of the collection lawyer letters generated by the model are more similar to those of legal practitioners, thereby facilitating acceptance by the recipients of the collection lawyer letters.
[0005] Technical Solution In order to achieve the above purpose, a method for automatically generating a collection lawyer's letter based on an artificial intelligence model is provided, comprising: S1. Collect legal documents, clean, standardize and structure them to form a legal knowledge base, and input the legal knowledge model to fill the underlying legal framework; S2. Use natural language processing technology to extract basic case information from historical collection lawyers' letters and import it into the legal knowledge model for training, so that it can understand and generate collection lawyers' letters that comply with laws, regulations and industry requirements. Then, further train the legal knowledge model based on the collection lawyers' letters generated by the model and historical collection lawyers' letters. S3. Obtain basic information of the collection case, import the trained legal knowledge model, and generate a collection lawyer's letter. Evaluate the performance of the model through cross-validation, accuracy, recall and other indicators, and continuously optimize it. In the scheme of the present invention, the legal documents are first processed and input into the legal knowledge model as the underlying legal framework, and then natural language processing technology is used to extract basic information from historical collection lawyers' letters and input into the legal knowledge model training. The model is further trained based on the generated collection lawyer's letter, and finally the basic information of the case is obtained and imported into the model to generate a collection lawyer's letter, thereby realizing the automatic generation of collection lawyer's letters, reducing the consumption of manpower and material resources, improving the operating efficiency of law firms, and solving the current problem of low efficiency in letter collection by law firms.
[0006] Furthermore, in step S1, the legal documents include current legal provisions, cases, judgments, rulings, etc.
[0007] Furthermore, in step S1, the legal knowledge model is embedded with a MAML meta-learning algorithm, so that when the legal provisions are updated, the model can learn the essence of the new legal provisions through new legal provisions or new legal precedents, thereby enabling the model to output collection lawyer letters that are adapted to the new legal provisions as the legal provisions are updated.
[0008] Furthermore, the steps of applying the embedded MAML meta-learning algorithm to learn new legal provisions in the legal knowledge model include: Task sampling: randomly sample a set of tasks from the legal text dataset, each task contains a support set and a query set; Optimization goal: The goal is to find a good initial parameter , so that it can adapt quickly and perform well after being updated on new tasks; Inner loop optimization: training on the support set, for each task, one or more gradient updates are performed using the support set to find the parameters that are suitable for the current task ; Outer loop optimization: Use the query set to evaluate the algorithm performance after the inner loop update, calculate the loss function of the outer loop, and update the original parameters based on the loss ; Among them, the loss function of the inner loop optimization is: , calculate the loss on the support set of the current task; the loss function of the outer loop optimization is: , calculate the sum of the losses on the query set of all tasks; where, Represents the original parameters of the model; represents the optimized parameters for the i-th task; , Represent the data of the support set and query set respectively. Legal provisions, judicial interpretations, judicial precedents, etc. are often updated. If the model is only replaced by the input legal documents, it may be difficult to quickly and accurately distinguish the key points of new and old legal provisions or judgment interpretations, which will cause the model to lag, be ambiguous, or even inconsistent. By embedding the MAML meta-learning algorithm in the model, it can take new legal provisions, new cases, and new judicial interpretations as tasks, so that the model can quickly adapt to the new legal environment and grow into an intelligent model that can understand and apply new legal provisions, new cases, and new judicial interpretations.
[0009] Furthermore, the optimization process of the MAML meta-learning algorithm involves two learning rates α and β, which are used to update the inner loop and the outer loop respectively: Inner loop update: ; Outer loop update: .
[0010] Furthermore, in step S2, the basic case information includes: borrower information, case time information, case legal information, case amount, interest rate information, and case business type.
[0011] Furthermore, in step S2, the historical collection attorney's letters include manually written collection attorney's letters and / or automatically generated historical collection letters.
[0012] Furthermore, in step S2, the purpose of further training the legal knowledge model based on the collection attorney's letter generated by the model and the historical collection attorney's letter is to enable the model to generate a collection attorney's letter whose difference from the manually written collection attorney's letter is less than a certain range.
[0013] Furthermore, in step S2, further training the legal knowledge model based on the collection lawyer's letter generated by the model and the historical collection lawyer's letter includes: S201, extracting important information of the collection lawyer's letter generated by the model and the historical collection lawyer's letter respectively, and performing word segmentation operation to obtain keyword extraction results; S202, using a vector tool to vectorize the keyword extraction results, and respectively construct a model corpus and a historical corpus with the corresponding keywords, parts of speech and word vectors; S203, using clustering algorithms to group word vectors and visualize differences to enrich and improve the model corpus, and using the model corpus to improve the legal knowledge model. Through the steps of important information extraction, word segmentation, keyword extraction, and vectorization, the sequence information, position information, and contextual semantic logical relationships in the text can be effectively extracted, and then a dynamic model corpus is obtained through operations such as clustering algorithms and visualized difference displays. After enriching and improving it, the legal knowledge model can be improved, and the legal knowledge model can be further trained. Through further training of the collection lawyer's letter generated by the model and the historical collection lawyer's letter, the accuracy and compliance of the system model can be ensured. The effect of the participation of the historical collection lawyer's letter in the training is similar to the regular or irregular invitation of legal experts and collection personnel to participate in the review and adjustment of the system model, thus greatly saving the review and adjustment costs of the system model.
[0014] Furthermore, in step S2, a more advanced natural language processing model is optimized and combined with the advantages of the BERT model: The word vector is combined with the positional encoding to obtain the word vector matrix, which is multiplied by the weight matrix to obtain the query matrix, key matrix and value matrix respectively: Transformer Model:
[0015] in, denote the query matrix, key matrix, and value matrix respectively; represents the dimension of the key vector; Represents relative position encoding; the Transformer model improves the ability to understand context through a multi-head attention mechanism. By introducing the relative position encoding of words , which can effectively enhance the model's ability to perceive word order, and verify the unexpected relative position encoding The introduction of can make the model pay attention to the probability of occurrence of high-frequency words, so that when the debtor shows good intentions, bad intentions or other tendencies, a matching collection lawyer's letter can be generated, which does not exceed the legal and regulatory level, is more deterrent and normative in terms of language expression, and can even adjust the details of the debt and repayment requirements according to the specific circumstances of the customer, so as to achieve efficient collection to the greatest extent.
[0016] Furthermore, in step S2, further training the legal knowledge model based on the collection lawyer's letter generated by the model and the historical collection lawyer's letter also includes improving the evaluation index to evaluate the difference between the collection lawyer's letter generated by the model and the historical collection lawyer's letter corresponding to the basic information of the corresponding case, so as to further improve the model performance. Specifically, the difference is based on the difference between sentences with independent semantics. Indicators to indicate:
[0017] in, represents the short sentence penalty factor, ensuring that longer and accurate generated sentences are not unfairly evaluated due to their length; The first indivual The accuracy of the sentence generated by the model The sentences in the historical collection lawyer's letter The proportion of the number of express length; by analyzing the length of sentences Indicators, and then obtain the full collection letter Based on the above improved evaluation indicators, the difference between the collection lawyer's letter generated by the model and the historical collection lawyer's letter corresponding to the basic information of the corresponding case can be quantified at the scale of specific fragments, words, and texts. Based on the differences, the model performance can be further improved, so that the writing style, word order context, etc. of the collection lawyer's letter generated by the model are more similar to those of legal practitioners, which is conducive to the acceptance of the recipients of the collection lawyer's letter.
[0018] Furthermore, in step S3, the legal expert reviews and adjusts the generated attorney's letter for debt collection to ensure the accuracy and compliance of the attorney's letter, and then uses it as a formal attorney's letter for debt collection.
[0019] The system for generating collection lawyer's letters based on the legal knowledge model includes: A data collection and preprocessing module, which is configured to obtain basic information of collection cases and perform preprocessing; A legal knowledge model module, which is configured to input the preprocessed data into the legal knowledge model, and generate personalized collection letters and collection text information according to the aforementioned method for automatically generating collection lawyer letters based on the artificial intelligence model; The electronic signature module is configured to call the law firm's digital certificate electronic signature and pass the compliance review of the audit model; The letter processing module is configured to send the signed collection lawyer's letter to the target customer and track the reach and obtain real-time feedback from the borrower; The data storage module is configured to locally store and blockchain-store original data, pre-processed data, generated collection letters, collection text information, and letter sending information.
[0020] Furthermore, the system also includes an application module, which is configured to implement a user interaction interface, including functions such as input of original information, automatic generation of collection lawyer's letters, and real-time interaction with a dialogue system.
[0021] Furthermore, the legal knowledge model module is also configured as a dialogue system that supports the application module, and continuously optimizes and improves the application module by continuously collecting user feedback and data information, so as to gradually improve the intelligent performance of the application module.
[0022] A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program that can be executed by a processor, and when the computer program is executed by the processor, at least one step of the aforementioned method for automatically generating a collection lawyer's letter based on an artificial intelligence model is executed.
[0023] A computer device, comprising a memory, a processor, a communication interface and a communication bus; wherein the memory, the processor and the communication interface communicate with each other via the communication bus; the memory is used to store computer programs; the processor is used to execute the computer programs stored in the memory, and when the processor executes the computer program, at least one step of the aforementioned method of automatically generating a collection lawyer's letter based on an artificial intelligence model is implemented.
[0024] Based on the common knowledge in this field, the above-mentioned preferred conditions can be combined with each other to obtain a specific implementation method.
[0025] Beneficial Effects According to the present invention, by importing legal documents and basic information of collection cases into the legal knowledge model, a collection lawyer's letter is automatically generated, thereby realizing the automatic generation of a collection lawyer's letter, reducing the consumption of manpower and material resources, improving the operating efficiency of the law firm, and solving the current problem of low efficiency in letter collection by law firms.
[0026] By embedding the MAML meta-learning algorithm in the model, new legal provisions, new cases, and new judicial interpretations can be used as tasks to enable the model to quickly adapt to the new legal environment, allowing it to grow into an intelligent model that can understand and apply new legal provisions, new cases, and new judicial interpretations. Verification results show that the MAML meta-learning algorithm can enable the model to quickly adapt to new legal provisions or generate lawyer letters with guiding tendencies of new cases and new judicial interpretations.
[0027] Through the steps of important information extraction, word segmentation, keyword extraction, and vectorization, the sequence information, position information, and contextual semantic logical relationships in the text can be effectively extracted, and then a dynamic model corpus can be obtained through clustering algorithms, visual difference display, and other operations. After enriching and improving it, the legal knowledge model can be improved, and the legal knowledge model can be further trained. Through further training of the collection lawyer's letter generated by the model and the historical collection lawyer's letter, the accuracy and compliance of the system model can be ensured. The effect of the participation of historical collection lawyer's letters in the training is similar to the regular or irregular invitation of legal experts and collection personnel to participate in the review and adjustment of the system model, thus greatly saving the review and adjustment costs of the system model.
[0028] The model is also equipped with an improved evaluation index to evaluate the difference between the collection attorney's letter generated by the model and the historical collection attorney's letter corresponding to the basic information of the corresponding case. The improved evaluation index can quantify the difference between the collection attorney's letter generated by the model and the historical collection attorney's letter corresponding to the basic information of the corresponding case at the scale of specific fragments, words, and texts. Based on the difference, the model performance can be further improved, so that the writing style, word order context, etc. of the collection attorney's letter generated by the model are more similar to those of legal practitioners, thereby facilitating acceptance by the recipients of the collection attorney's letter.
[0029] The present invention adopts the above technical solution to achieve the above purpose, which makes up for the shortcomings of the prior art and has reasonable design and convenient operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to make the above and / or other purposes, features, advantages and examples of the present invention more obvious and easy to understand, the drawings required for use in the specific implementation of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 A flow chart showing a method for automatically generating a collection lawyer's letter based on an artificial intelligence model; Figure 2 A flowchart showing further training of the legal knowledge model based on the collection lawyer's letter generated by the model and the historical collection lawyer's letter; Figure 3 A schematic diagram showing the framework of the legal knowledge model; Figure 4 A schematic diagram of a system for generating and sending collection lawyer letters based on a legal knowledge model. DETAILED DESCRIPTION
[0032] Those skilled in the art can refer to the content of this article and appropriately replace and / or modify the process parameters to achieve the same. However, it should be particularly noted that all similar replacements and / or modifications are obvious to those skilled in the art and are considered to be included in the present invention. The products and preparation methods described in the present invention have been described through preferred examples. It is obvious that relevant personnel can modify or appropriately change and combine the products and preparation methods described herein without departing from the content, spirit and scope of the present invention to implement and apply the technology of the present invention.
[0033] Unless otherwise defined, technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the invention belongs. The present invention uses the methods and materials described herein; however, other suitable methods and materials known in the art may also be used. The materials, methods, and examples described herein are illustrative only and are not intended to be limiting. All publications, patent applications, patents, provisional applications, database entries, and other references mentioned herein are incorporated herein by reference in their entirety. In the event of a conflict, the present specification, including definitions, shall prevail.
[0034] Unless specifically stated, the materials, methods, and examples described herein are illustrative only and not limiting. Although methods and materials similar or equivalent to those described herein can be used in the practice or testing of the present invention, suitable methods and materials are still described herein.
[0035] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention. At the same time, the embodiments in this application and the features in the embodiments can be combined with each other without conflict.
[0036] The present invention is described in detail below Embodiment 1: Provide a method for automatically generating collection lawyer letters based on an artificial intelligence model, such as Figure 1 As shown, the following steps are included.
[0037] S1. Filling in the underlying legal framework Collect legal documents including current legal provisions, interpretations, cases, judgments, rulings, etc., such as the Contract Law, the Civil Code, the Judicial Interpretation of Financial Loan Contract Disputes, the Provisions on Several Issues Concerning the Application of Law in the Trial of Private Lending Cases and their amendments and interpretations, the Personal Loan Management Measures and related cases, judgments, rulings, etc., and then clean, standardize and structure them to form a legal knowledge base, input the legal knowledge model to fill the underlying legal framework, and ensure that the content of the lawyer's letter meets legal requirements. According to the specific collection situation, determine the cited legal terms, which will serve as the legal basis for the content of the lawyer's letter, such as: contract performance terms, breach of contract liability terms, overdue interest calculation terms, etc.
[0038] In step S1, the legal knowledge model is embedded with the MAML meta-learning algorithm, which is used to enable the model to learn the essence of the new legal provisions through new legal provisions or new legal precedents when the legal provisions are updated, so that the model can output the collection lawyer's letter adapted to the new legal provisions as the legal provisions are updated. When there are new legal provisions and the interpretations, cases, judgments, rulings, etc. applicable to the update, the MAML meta-learning algorithm is applied to learn the new legal provisions. The specific steps include: Task sampling: randomly sample a set of tasks from the legal text dataset, each task contains a support set and a query set; Optimization goal: The goal is to find a good initial parameter , so that it can adapt quickly and perform well after being updated on new tasks; Inner loop optimization: training on the support set, for each task, one or more gradient updates are performed using the support set to find the parameters that are suitable for the current task ; Outer loop optimization: Use the query set to evaluate the algorithm performance after the inner loop update, calculate the loss function of the outer loop, and update the original parameters based on the loss ; Among them, the loss function of the inner loop optimization is: , calculate the loss on the support set of the current task; the loss function of the outer loop optimization is: , calculate the sum of the losses on the query set of all tasks; where, Represents the original parameters of the model; represents the optimized parameters for the i-th task; , Represent the data of the support set and query set respectively. The optimization process of the MAML meta-learning algorithm involves two learning rates α and β, which are used to update the inner loop and outer loop respectively: Inner loop update: ;Outer loop update: . By embedding the MAML meta-learning algorithm in the model, the model can quickly adapt to the new legal environment with new legal provisions, new cases, and new judicial interpretations as tasks, so that it can grow into an intelligent model that can understand and apply new legal provisions, new cases, and new judicial interpretations. When further single-factor verification of the MAML meta-learning algorithm is performed, that is, the new legal provisions or new legal precedents are respectively input as the underlying legal framework in the model without or with the MAML meta-learning algorithm embedded, and then the basic information of the case is imported to verify the generated collection lawyer's letter. The verification results show that the MAML meta-learning algorithm can enable the model to quickly adapt to the new legal provisions or the generated lawyer's letter has the guiding tendency of new cases and new judicial interpretations, while the model without the MAML meta-learning algorithm embedded takes some time to adapt to the new legal provisions, and even there may be contradictions in the logical adaptation of the previous and subsequent laws. Therefore, the embedded MAML meta-learning algorithm enables the model to quickly learn the essence of the new legal provisions, so as to output the collection lawyer's letter adapted to the new legal provisions faster and more accurately.
[0039] S2. Training the legal knowledge model Using natural language processing technology, basic case information is extracted from historical collection lawyer letters. Historical collection lawyer letters include manually written collection lawyer letters and / or automatically generated collection historical letters. Collection lawyer letters that can exert legal effect and are compliant and legal can be used as historical collection lawyer letters for training legal knowledge models. The basic case information includes: 1. Recipient information: customer name, address, contact information, etc.; 2. Sender information: law firm name, address, contact information, etc.; 3. Debt details: loan contract number, loan amount, overdue time, remaining debt amount, interest rate, principal and interest payable, etc.; 4. Legal basis: cited legal clauses and legal interpretations; 5. Repayment requirements: clear repayment amount, repayment method, final repayment period, etc.; 6. Legal consequences: possible legal consequences of overdue non-repayment, such as litigation, asset freezing, etc.; 7. Contact information: contact information of the law firm or responsible lawyer. Import the basic information of the case into the legal knowledge model for training, so that it can understand and generate collection attorney letters that comply with laws, regulations and industry requirements. Then further train the legal knowledge model based on the collection attorney letters generated by the model and historical collection attorney letters until the model can generate collection attorney letters that differ from manually written collection attorney letters within a certain range. If the difference is within a certain range, specific legal practitioners can determine that the collection attorney letters automatically generated by the model are sufficient for debt collection for general individuals, families, small groups or small and medium-sized enterprises.
[0040] In step S2, Figure 2 As shown, further training of the legal knowledge model based on the collection lawyer's letter generated by the model and the historical collection lawyer's letter includes: S201, extracting important information of the collection lawyer's letter generated by the model and the historical collection lawyer's letter respectively, and performing word segmentation operation to obtain keyword extraction results; S202, using a vector tool to vectorize the keyword extraction results, and respectively construct a model corpus and a historical corpus with the corresponding keywords, parts of speech and word vectors; S203, use clustering algorithm to group word vectors and visualize differences, so as to enrich and improve the model corpus, and use the model corpus to improve the legal knowledge model. The trained legal knowledge model framework is obtained as follows: Figure 3 shown.
[0041] In step S2, a more advanced natural language processing model is optimized and the advantages of the BERT model are combined: The word vector is combined with the positional encoding to obtain the word vector matrix, which is multiplied by the weight matrix to obtain the query matrix, key matrix and value matrix respectively: Transformer Model:
[0042] in, denote the query matrix, key matrix, and value matrix respectively; represents the dimension of the key vector; Represents relative position encoding; the Transformer model improves its ability to understand context through a multi-head attention mechanism. Actual case verification shows that relative position encoding in the Transformer model The introduction of can make the collection lawyer's letter derived by the model adapt to the good or bad intentions of the debtor. When the debtor has malicious input information such as "I will never pay back", "You are illegal", "What can you do if you don't pay back", "It doesn't matter", etc., the output collection lawyer's letter will contain more intimidating or deterrent words such as "credit investigation", "illegal", "further accountability", "prosecution", etc.; and when the debtor has good input information such as "sorry", "as soon as possible", "timely", "difficult", etc., the collection lawyer's letter output by the model will contain more humane and soothing words such as "can be delayed", "please contact by phone", "please go to the law firm for detailed discussion". Therefore, it can be seen that relative position coding The introduction of can enable the model to automatically learn the corresponding tendencies in historical collection lawyer letters based on the good or evil intentions of the debtor and realize them as similar expressions in the collection lawyer letters, thereby realizing personalized and targeted generation of collection lawyer letters, thereby achieving efficient collection to a greater extent.
[0043] In step S2, when the legal knowledge model is further trained based on the collection lawyer's letter generated by the model and the historical collection lawyer's letter, it also includes improving the evaluation index to evaluate the difference between the collection lawyer's letter generated by the model and the historical collection lawyer's letter corresponding to the basic information of the corresponding case, so as to further improve the model performance. Specifically, the difference is based on the difference between sentences with independent semantics. Indicators to indicate:
[0044] in, represents the short sentence penalty factor, ensuring that longer and accurate generated sentences are not unfairly evaluated due to their length; The first indivual The accuracy of the sentence generated by the model The sentences in the historical collection lawyer's letter The proportion of the number of express length; by analyzing the length of sentences Indicators, further obtain the full collection letter Indicators, and then obtain the evaluation indicators. The indicator is used as an improved evaluation indicator to evaluate the difference between the collection lawyer's letter generated by the model and the historical collection lawyer's letter corresponding to the basic information of the corresponding case. Specifically, a single factor verification of the evaluation indicator is performed, that is, to obtain the results without applying the above Model 1 of the indicator and the above Model 2 of the indicator is used as an internal test model. The basic information of cases derived from the historical manually written collection lawyer letters that have not been imported into the model is input as the test set, totaling 225 cases. After the collection lawyer letters are output, they are handed over to the same group of 10 experienced legal practitioners for evaluation. The evaluation criteria are: 1 is the most likely lawyer letter written by a machine, and 5 is the most likely lawyer letter written by a human. The 225 lawyer letters output by model 1 and the 225 lawyer letters output by model 2 are evaluated respectively. The test results show that the average score of the lawyer letters output by model 1 is 2.2±0.8, while the average score of the lawyer letters output by model 2 is 4.5±0.4. The results show that the above-mentioned lawyer letters are more likely to be written by machines. As a solution to improve the evaluation indicators, the indicator can make the writing style, word order and context of the collection lawyer's letter generated by the model more similar to those of legal practitioners. The debtor is more likely to believe that the collection lawyer's letter he received was written by a specific lawyer himself, which makes him feel that the case is highly valued, effectively accelerates his repayment process and increases the effective collection ratio.
[0045] In step S2, after the legal knowledge model is trained, an unseen data set, i.e., new case basic information, is used to input the model to check whether the collection lawyer's letter generated by it meets the requirements, and professional legal practitioners are invited to review the collection lawyer's letter generated by the model to ensure its accuracy and legality, including: content review: check whether the content of the lawyer's letter is complete and accurate; legal review: check whether the cited legal terms and interpretations are correct; language review: check whether the language expression is standardized and professional. According to the lawyer's advice, confirm whether necessary modifications or adjustments need to be made to the lawyer's letter.
[0046] S3. Generate a collection lawyer's letter Obtain basic information of collection cases, including: 1. Recipient information: customer name, address, contact information, etc.; 2. Sender information: law firm name, address, contact information, etc.; 3. Debt details: loan contract number, loan amount, overdue time, remaining amount owed, interest rate, principal and interest payable, etc.; 4. Repayment requirements: clear repayment amount, repayment method, final repayment period, etc.; 5. Contact information: contact information of the law firm or responsible lawyer. Clean and organize the collected basic information of the case, including deduplication, completion, and verification, to ensure the accuracy, completeness, timeliness, consistency and legality of the data. Import the basic information of the case into the trained legal knowledge model to generate a collection lawyer's letter, evaluate the performance of the model through cross-validation, accuracy, recall and other indicators, and continuously optimize it; legal experts review and adjust the generated collection lawyer's letter to ensure the accuracy and compliance of the lawyer's letter, and then use it as a formal collection lawyer's letter.
[0047] Embodiment 2: like Figure 4 As shown, based on Example 1, a system for generating and sending a collection lawyer's letter based on a legal knowledge model is provided, including: A data collection and preprocessing module, which is configured to obtain basic information of collection cases and perform preprocessing, including cleaning and sorting; A legal knowledge model module, which is configured to input the preprocessed data into the legal knowledge model, and generate personalized collection letters and collection text information according to the aforementioned method for automatically generating collection lawyer letters based on the artificial intelligence model; The electronic signature module is configured to call the law firm's digital certificate electronic signature and pass the compliance review of the audit model; The letter processing module is set to send the signed collection lawyer's letter to the target customer through appropriate delivery methods such as mail, email or SMS notification. When choosing the delivery method, you need to consider: delivery confirmation: ensure that the collection lawyer's letter can be accurately delivered to the recipient, that is, the target customer; delivery record: keep the delivery record as evidence for subsequent legal actions; timeliness: choose the most timely delivery method based on the arrears, so first verify the recipient's address to ensure accurate delivery, and then send the lawyer's letter in the selected method, save the delivery record and receipt as evidence. The letter processing module can also track the reach and obtain real-time feedback from the borrower, including: recording customer feedback and repayment progress, recording the content and results of communication with customers, regularly tracking repayment progress, and updating system records.
[0048] A data storage module, which is configured to store the original data, pre-processed data, generated collection letters, collection text information and letter sending information locally and in blockchain; The application module is configured to implement a user interaction interface, including the input of original information, automatic generation of lawyer's letters for collection, and real-time interaction of the dialogue system. The dialogue system continuously collects user feedback and data information to continuously optimize and improve the application module, thereby gradually improving the intelligent performance of the application module. The application module appropriately adjusts the collection strategy based on the letter processing module's letter sending, reach, and borrower real-time feedback, including further possible legal actions, specifically: Strategy evaluation: evaluate the effectiveness of the current strategy based on customer feedback and repayment progress; Strategy adjustment: adjust the collection strategy based on the evaluation results, such as increasing the frequency of collection, changing the collection method, etc.; Legal action: if the customer still fails to repay, consider taking further legal actions, such as litigation, asset freezing, etc.
[0049] The present invention provides a system for generating and sending collection lawyer's letters based on a legal knowledge model. Through the steps of collecting and preparing data, determining legal basis, designing templates, building legal models, automatically generating lawyer's letters, reviewing and modifying, sending lawyer's letters, tracking and providing feedback, etc., it is possible to collect debts efficiently, in a standardized and legal manner, reduce the consumption of manpower and material resources, improve the operating efficiency of law firms, and solve the current problem of low efficiency in collecting debts by law firms' letters.
[0050] Embodiment 3: A computer-readable storage medium is also provided, which stores a computer program that can be executed by a processor. When the computer program is executed by the processor, it runs at least one step of the aforementioned method for automatically generating a collection lawyer's letter based on an artificial intelligence model, and can achieve the same technical effect. To avoid repetition, this embodiment will not be described in detail.
[0051] Embodiment 4: A computer device, comprising a memory, a processor, a communication interface and a communication bus; wherein the memory, the processor and the communication interface communicate with each other via the communication bus; the memory is used to store computer programs; the processor is used to execute the computer programs stored in the memory, and when the processor executes the computer program, it implements at least one step of the aforementioned method for automatically generating a collection lawyer's letter based on an artificial intelligence model, and can achieve the same technical effect. To avoid repetition, this embodiment will not be described in detail.
[0052] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PR AM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0053] The conventional techniques in the above embodiments are prior arts known to those skilled in the art, and thus will not be described in detail here.
[0054] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.
[0055] Although the present invention has been described in detail and some specific embodiments have been cited, it is obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit and scope of the present invention.
[0056] Although the above-mentioned specific embodiments have been shown, described and pointed out the novel features applied to various embodiments, it should be understood that various omissions, substitutions and changes can be made to the form and details of the described device or method without departing from the spirit of the present disclosure. In addition, the above-mentioned various features and methods can be used independently of each other, or can be combined in various ways. All possible combinations and sub-combinations are intended to fall within the scope of the present disclosure. Many of the above-mentioned embodiments include similar components, and therefore, these similar components are interchangeable in different embodiments. Although the present invention has been disclosed in the context of certain embodiments and examples, it should be understood by those skilled in the art that the present invention can extend beyond the specifically disclosed embodiments to other alternative embodiments and / or applications and obvious modifications and equivalents thereof. Therefore, the present invention is not intended to be limited by the specific disclosure of the preferred embodiments herein.
[0057] Matters not covered in the present invention are all known technologies.
Claims
1. The method for automatically generating a collection lawyer's letter based on an artificial intelligence model is characterized by include: S1. Collect legal documents, clean, standardize, and structure them to form a legal knowledge base, and input the legal knowledge model to fill the underlying legal framework; S2. Leveraging natural language processing technology, we extract basic case information from historical collection attorney letters and import it into a legal knowledge model for training. This allows the model to understand and generate collection attorney letters that comply with laws, regulations, and industry requirements. The legal knowledge model is then further trained based on the model-generated collection attorney letters and historical collection attorney letters. S3. Obtain basic information about the collection case, import the trained legal knowledge model, and generate a collection lawyer's letter.
2. The method according to claim 1, wherein: In step S1, the legal knowledge model is embedded with the MAML meta-learning algorithm, so that when legal provisions are updated, the model can learn the essence of new legal provisions through new legal provisions or new legal precedents.
3. The method according to claim 2, wherein: The steps of using the embedded MAML meta-learning algorithm in the legal knowledge model to learn new legal provisions include: Task sampling: Randomly sample a set of tasks from the legal text dataset, where each task contains a support set and a query set. Optimization goal: The goal is to find a good initial parameter , so that it can adapt quickly and perform well after being updated on new tasks; Inner loop optimization: training is performed on the support set. For each task, one or more gradient updates are performed using the support set to find the parameters that are suitable for the current task. ; Outer loop optimization: Use the query set to evaluate the algorithm performance after the inner loop update, calculate the loss function of the outer loop, and update the original parameters based on the loss ; Among them, the loss function of inner loop optimization is: , calculate the loss on the support set of the current task; the loss function optimized by the outer loop is: , calculate the sum of the losses on the query set of all tasks; where, Represents the original parameters of the model; represents the optimized parameters for the i-th task; 、 Represent the data of the support set and query set respectively.
4. The method according to claim 1, wherein: In step S2, the purpose of further training the legal knowledge model based on the collection lawyer's letter generated by the model and the historical collection lawyer's letter is to enable the model to generate a collection lawyer's letter whose difference from the manually written collection lawyer's letter is less than a certain range.
5. The method according to claim 1 or 4, characterized in that: In step S2, further training the legal knowledge model based on the collection lawyer's letter generated by the model and the historical collection lawyer's letter includes: S201. Extract important information from the collection attorney's letter generated by the model and historical collection attorney's letters, perform word segmentation operations, and obtain keyword extraction results; S202. Use a vectorization tool to vectorize the keyword extraction results, and form a model corpus and a historical corpus with the corresponding keywords, parts of speech, and word vectors; S203. Use a clustering algorithm to group word vectors and visualize the differences, thereby enriching and improving the model corpus, and using the model corpus to improve the legal knowledge model.
6. The method according to claim 5, characterized in that: In step S2, a more advanced natural language processing model is optimized and combined with the advantages of the BERT model: The word vector is combined with the positional encoding to obtain the word vector matrix, which is multiplied by the weight matrix to obtain the query matrix, key matrix, and value matrix respectively: Transformer model: in, represent the query matrix, key matrix, and value matrix respectively; represents the dimension of the key vector; Represents relative position encoding; the Transformer model improves its ability to understand context through a multi-head attention mechanism.
7. The method according to claim 1 or 2, characterized in that: In step S2, further training the legal knowledge model based on the collection lawyer's letter generated by the model and the historical collection lawyer's letter also includes improving the evaluation index to evaluate the difference between the collection lawyer's letter generated by the model and the historical collection lawyer's letter corresponding to the basic information of the corresponding case, thereby further improving the model performance. Specifically, the difference is measured by the difference between sentences with independent semantics. Indicators to represent: in, represents the short sentence penalty factor, ensuring that longer and accurate generated sentences are not unfairly evaluated due to their length; The first indivual The accuracy of the sentence generated by the model The sentence in the historical debt collection lawyer's letter the proportion of the number of express length of the sentence; by analyzing the Indicators, and then obtain the full collection letter Indicators, and then the evaluation indicators are obtained.
8. The system for generating collection lawyer letters based on legal knowledge models is characterized by include: A data collection and preprocessing module, which is configured to obtain basic information of debt collection cases and perform preprocessing; a legal knowledge model module configured to input the preprocessed data into a legal knowledge model, and generate personalized collection letters and collection text information according to the method for automatically generating collection lawyer letters based on an artificial intelligence model as described in any one of claims 1 to 7; The electronic signature module is configured to call the law firm's digital certificate electronic signature and pass the compliance review of the audit model; A letter processing module, which is configured to send signed collection letters to target clients, track their reach, and obtain real-time feedback from borrowers; The data storage module is configured to store the original data, pre-processed data, generated collection letters, collection text information and letter sending information locally and on the blockchain.
9. A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by a processor, wherein when the computer program is executed by the processor, at least one step of the method for automatically generating a collection lawyer's letter based on an artificial intelligence model as described in any one of claims 1 to 7 is executed.
10. A computer device comprising a memory, a processor, a communication interface, and a communication bus; wherein: The memory, processor, and communication interface communicate with each other through the communication bus; the memory is used to store computer programs; the processor is used to execute the computer programs stored in the memory, and when the processor executes the computer program, it performs at least one step of the method for automatically generating a collection lawyer's letter based on an artificial intelligence model as described in any one of claims 1 to 7.
