Credit soft clause identification method, device and equipment
By combining a similarity dual-tower model with a customer dimension to process letter of credit messages, the problem of low accuracy in identifying soft clauses in letters of credit is solved, and more efficient letter of credit processing is achieved.
Patent Information
- Application Number
- CN202511749629.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-02-17
AI Technical Summary
The accuracy of identifying soft clauses in letters of credit in existing technologies is low, resulting in low efficiency for business personnel when processing letters of credit.
A similarity dual-tower model is adopted, which combines customer dimensions to process soft clauses in letter of credit messages. Soft clauses are identified by similarity matching, including similarity matching of a preset first set of soft clauses and a second set of soft clauses. The model is optimized using a training sample set to improve the identification accuracy.
By taking into account the semantic description habits of different customers, the accuracy of identifying soft clauses in letters of credit has been improved, thus increasing the processing efficiency of business personnel.
Smart Images

Figure CN121542431A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to methods, apparatus and equipment for identifying soft clauses in letters of credit. Background Technology
[0002] In international trade, letters of credit are an important tool for protecting the interests of both parties. However, certain terms in letters of credit may bring unnecessary risks and difficulties to exporters; these are known as "soft terms" or "trap terms."
[0003] The "soft clauses" in letters of credit are crucial to customer interests and require significant time from sales personnel for identification. Using natural language processing models to classify soft clauses can effectively improve the efficiency of document review. However, due to the strong semantic generalization of soft clauses, feature word / rule identification is difficult to implement, resulting in low accuracy in soft clause identification.
[0004] Therefore, there is a lack of efficient and accurate methods for identifying soft clauses in letters of credit in the relevant technologies. Summary of the Invention
[0005] This application provides a method, apparatus, and device for identifying soft clauses in letters of credit, which addresses the problem of low accuracy in identifying soft clauses in letters of credit in related technologies.
[0006] In a first aspect, embodiments of this application provide a method for identifying soft clauses in letters of credit, the method comprising: Receive a letter of credit message to be processed, determine the customer object corresponding to the letter of credit message, and extract the set of soft clauses to be identified from the letter of credit message; For each soft clause to be identified in the set of soft clauses to be identified, perform the following operations: A similarity dual-tower model is adopted to perform similarity matching between the soft clause to be identified and each first soft clause in the preset first soft clause set, resulting in multiple first similarities, each first similarity corresponding to one first soft clause; the first soft clause set corresponds to the customer object; If any of the plurality of first similarities is greater than a preset first threshold, then the soft clause to be identified and the first soft clause corresponding to any of the first similarities are determined to be clauses of the same category. If the multiple first similarities are less than or equal to a preset first threshold, then the similarity dual-tower model is used to perform similarity matching between the soft clause to be identified and each second soft clause in the preset set of second soft clauses, to obtain multiple second similarities, each second similarity corresponding to a second soft clause; the second soft clause set corresponds to multiple different customer objects; If any of the plurality of second similarities is greater than a preset second threshold, then the soft clause to be identified and the second soft clause corresponding to any of the second similarities are determined to be clauses of the same category.
[0007] In this embodiment, customer-level processing is added during the soft clause data preparation stage. This allows the dual-tower similarity model to take into account both the semantics of general terms and the unique semantic description scenarios of each customer's terms. It also takes into account the semantic description habits of different users and uses the dual-tower similarity model to identify and classify soft clauses. This enables more accurate identification of soft clauses in letters of credit from different customers and improves the efficiency of letter of credit processing for business personnel.
[0008] In one possible embodiment, the similarity dual-tower model is trained using the following method: Obtain a training sample set, which includes a sample soft clause set and a set of positive candidate clauses and a set of negative candidate clauses corresponding to the sample soft clause set; Each sample soft clause in the sample soft clause set, each positive candidate clause in the positive candidate clause set, and each negative candidate clause in the negative candidate clause set are respectively input into the similarity dual-tower model for training; The loss function constructed for training the similarity dual-tower model is used to ensure that the similarity between positive candidate clauses in the positive candidate clause set and negative candidate clauses in the negative candidate clause set is less than the similarity between positive candidate clauses in the positive candidate clause set and sample soft clauses in the sample soft clause set.
[0009] In one possible embodiment, the loss function constructed for training the similarity dual-tower model is further used to ensure that the similarity between positive candidate clauses in the positive candidate clause set and sample soft clauses in the sample soft clause set is greater than the similarity between negative candidate clauses in the negative candidate clause set and sample soft clauses in the sample soft clause set.
[0010] In one possible implementation, the training sample set is constructed using the following method: For each sample soft clause in the sample soft clause set, based on the customer object corresponding to the sample soft clause, soft clauses in historical letter of credit messages corresponding to the same customer object are determined as positive candidate clauses of the sample soft clause; Non-soft clauses in historical letter of credit messages are identified as negative candidate clauses for the sample soft clauses.
[0011] In one possible embodiment, the positive candidate clauses also include soft clauses in the historical letter of credit messages corresponding to different customer objects; The negative candidate clauses include non-soft clauses corresponding to the same customer, non-soft clauses corresponding to different customers, and non-clauses in the historical letter of credit messages.
[0012] In one possible embodiment, the use of a similarity dual-tower model to perform similarity matching on the soft clause to be identified and each first soft clause in the first soft clause set, obtaining multiple first similarities between the soft clause to be identified and each first soft clause, including: The soft clause to be identified is used as the first input of the similarity dual-tower model, and each first soft clause in the first soft clause set is used as the second input of the similarity dual-tower model. The similarity dual-tower model transforms the first input into a first vector and each second input into a second vector. The cosine similarity between the first vector and each of the second vectors is used as the first similarity between the soft clause to be identified and the corresponding first soft clause.
[0013] In one possible embodiment, the step of employing the similarity dual-tower model to perform similarity matching on each second soft clause in the set of the soft clause to be identified and the second soft clause, and obtaining a second similarity between the soft clause to be identified and each second soft clause, includes: The soft clause to be identified is used as the third input of the similarity dual-tower model, and each second soft clause in the second soft clause set is used as the fourth input of the similarity dual-tower model. The similarity dual-tower model transforms the third input into a third vector and the multiple fourth inputs into multiple fourth vectors. The cosine similarity between the third vector and each of the plurality of fourth vectors is determined to obtain a plurality of second similarities between the soft clause to be identified and each of the second soft clauses.
[0014] Secondly, this application provides a device for identifying soft clauses in letters of credit, the device comprising: The soft clause extraction unit is configured to receive a letter of credit message to be processed, determine the customer object corresponding to the letter of credit message, and extract a set of soft clauses to be identified from the letter of credit message. For each soft clause to be identified in the set of soft clauses to be identified, perform the following operations: The first similarity determination unit is configured to use a similarity dual-tower model to perform similarity matching between the soft clause to be identified and each first soft clause in a preset set of first soft clauses, thereby obtaining multiple first similarities, each first similarity corresponding to a first soft clause; the first set of soft clauses corresponds to the customer object; The first category determination unit is configured to determine that the soft clause to be identified and the first soft clause corresponding to any of the plurality of first similarities are of the same category if any of the first similarities is greater than a preset first threshold. The second similarity determination unit is configured to, if the plurality of first similarities are less than or equal to a preset first threshold, use the similarity dual-tower model to perform similarity matching on the soft clause to be identified and each second soft clause in the preset set of second soft clauses to obtain a plurality of second similarities, each second similarity corresponding to a second soft clause; the second soft clause set corresponds to a plurality of different customer objects; The second category determination unit is configured to determine that the soft clause to be identified and the second soft clause corresponding to any of the plurality of second similarities are of the same category if any of the second similarities is greater than a preset second threshold.
[0015] In one possible embodiment, a model training unit is also included, configured to train the similarity dual-tower model using the following method: Obtain a training sample set, which includes a sample soft clause set and a set of positive candidate clauses and a set of negative candidate clauses corresponding to the sample soft clause set; Each sample soft clause in the sample soft clause set, each positive candidate clause in the positive candidate clause set, and each negative candidate clause in the negative candidate clause set are respectively input into the similarity dual-tower model for training; The loss function constructed for training the similarity dual-tower model is used to ensure that the similarity between positive candidate clauses in the positive candidate clause set and negative candidate clauses in the negative candidate clause set is less than the similarity between positive candidate clauses in the positive candidate clause set and sample soft clauses in the sample soft clause set.
[0016] In one possible embodiment, the loss function constructed for training the similarity dual-tower model is further used to ensure that the similarity between positive candidate clauses in the positive candidate clause set and sample soft clauses in the sample soft clause set is greater than the similarity between negative candidate clauses in the negative candidate clause set and sample soft clauses in the sample soft clause set.
[0017] In one possible embodiment, the model training unit is further configured to construct a training sample set using the following method: For each sample soft clause in the sample soft clause set, based on the customer object corresponding to the sample soft clause, soft clauses in historical letter of credit messages corresponding to the same customer object are determined as positive candidate clauses of the sample soft clause; Non-soft clauses in historical letter of credit messages are identified as negative candidate clauses for the sample soft clauses.
[0018] In one possible embodiment, the positive candidate clauses also include soft clauses in the historical letter of credit messages corresponding to different customer objects; The negative candidate clauses include non-soft clauses corresponding to the same customer, non-soft clauses corresponding to different customers, and non-clauses in the historical letter of credit messages.
[0019] In one possible embodiment, the similarity dual-tower model is adopted to perform similarity matching on the soft clause to be identified and each first soft clause in the first soft clause set, thereby obtaining multiple first similarities between the soft clause to be identified and each first soft clause. The first similarity determination unit is specifically configured as follows: The soft clause to be identified is used as the first input of the similarity dual-tower model, and each first soft clause in the first soft clause set is used as the second input of the similarity dual-tower model. The similarity dual-tower model transforms the first input into a first vector and each second input into a second vector. The cosine similarity between the first vector and each of the second vectors is used as the first similarity between the soft clause to be identified and the corresponding first soft clause.
[0020] In one possible embodiment, the similarity dual-tower model is used to perform similarity matching on each second soft clause in the set of soft clauses to be identified and the second soft clauses, respectively, to obtain a second similarity between the soft clause to be identified and each second soft clause. The second similarity determination unit is specifically configured as follows: The soft clause to be identified is used as the third input of the similarity dual-tower model, and each second soft clause in the second soft clause set is used as the fourth input of the similarity dual-tower model. The similarity dual-tower model transforms the third input into a third vector and the multiple fourth inputs into multiple fourth vectors. The cosine similarity between the third vector and each of the plurality of fourth vectors is determined to obtain a plurality of second similarities between the soft clause to be identified and each of the second soft clauses.
[0021] Thirdly, this application provides an electronic device, comprising: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the credit soft clause identification method described in any one of the first aspects according to the obtained program instructions.
[0022] Fourthly, this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the credit soft clause identification method described in any one of the first aspects.
[0023] Fifthly, this application provides a computer program product comprising: computer program code, which, when executed on a computer, causes the computer to perform the credit soft clause identification method described in any one of the first aspects.
[0024] The technical effects of any of the implementation methods in the second to fifth aspects can be found in the technical effects of the current implementation method in the first aspect, and will not be repeated here. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This application provides an illustration of an application scenario for a method for identifying soft clauses in letters of credit. Figure 2 A flowchart illustrating a method for identifying soft clauses in letters of credit provided in this application embodiment; Figure 3 This is a schematic diagram of the structure of the similarity twin-tower model provided in the embodiments of this application; Figure 4 A schematic diagram of the process for determining the first similarity provided in an embodiment of this application; Figure 5 A schematic diagram illustrating the process of determining the second similarity provided in an embodiment of this application; Figure 6 A structural diagram of a letter of credit soft clause recognition device provided in this application embodiment; Figure 7 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0028] The terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The term "multiple" in this application can mean at least two, for example, two, three, or more, and the embodiments of this application do not impose limitations.
[0029] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These embodiments should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that in the embodiments of this application, certain existing industry solutions such as software, components, and models may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0030] The acquisition, transmission, storage, and use of data in this application all comply with the requirements of relevant national laws and regulations.
[0031] Before introducing the method for identifying soft clauses in letters of credit provided in the embodiments of this application, the technical background of the embodiments of this application will be described in detail below for ease of understanding.
[0032] In international trade, letters of credit are an important tool for protecting the interests of both parties. However, certain terms in letters of credit may bring unnecessary risks and difficulties to exporters; these are known as "soft terms" or "trap terms."
[0033] The "soft clauses" in letters of credit are crucial to customer interests and require significant time from sales personnel for identification. Using natural language processing models to classify soft clauses can effectively improve the efficiency of document review. However, due to the strong semantic generalization of soft clauses, feature word / rule identification is difficult to implement, resulting in low accuracy in soft clause identification.
[0034] In view of this, embodiments of this application provide a method, apparatus, and device for identifying soft clauses in letters of credit, which solves the problem of low accuracy in identifying soft clauses in letters of credit in related technologies.
[0035] The inventive concept of this application can be summarized as follows: receiving a letter of credit message to be processed, determining the customer object corresponding to the letter of credit message, and extracting a set of soft clauses to be identified from the letter of credit message; for each soft clause to be identified in the set of soft clauses to be identified, a similarity dual-tower model is adopted to perform similarity matching between the soft clause to be identified and each first soft clause in a preset set of soft clauses corresponding to the customer object; when the first similarity is greater than a preset first threshold, it is determined that the soft clause to be identified and the corresponding first soft clause are clauses of the same category; otherwise, the soft clause to be identified and each second soft clause in a preset set of second soft clauses corresponding to multiple different customer objects are matched for similarity; when the second similarity is greater than a preset second threshold, it is determined that the soft clause to be identified and the corresponding second soft clause are clauses of the same category.
[0036] Therefore, in this embodiment of the application, customer-level processing is added during the soft clause data preparation stage, so that the similarity dual-tower model takes into account both the semantics of general terms and the unique semantic description scenarios of each customer's terms. It takes into account the semantic description habits of different users' terms, and by identifying and classifying soft clauses through the similarity dual-tower model, it can more accurately identify soft clauses in letters of credit of different customers, thereby improving the efficiency of letter of credit processing for business personnel.
[0037] After introducing the inventive concept of this application, the following will be combined with... Figure 1 The application scenarios of the embodiments of this application will be introduced.
[0038] Reference Figure 1 This is an application scenario diagram of a method for identifying soft clauses in letters of credit provided in an embodiment of this application. Figure 1 As shown, the scenario includes: terminal device 110 and server 120, and terminal device 110 and server 120 can communicate with each other through a communication network.
[0039] In one alternative implementation, the communication network can be a wired network or a wireless network. Therefore, the terminal device 110 and the server 120 can be connected directly or indirectly via wired or wireless communication. For example, the terminal device 110 can be indirectly connected to the server 120 via a wireless access point, or the terminal device 110 can be directly connected to the server 120 via the Internet; this application does not impose any limitations on this.
[0040] In the embodiments of this application, the terminal device 110 includes, but is not limited to, mobile phones, tablets, laptops, desktop computers, e-book readers, smart voice interaction devices, smart home appliances, vehicle terminals, and other devices.
[0041] Server 120 is the backend server corresponding to terminal device 110. Server 120 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0042] It should be noted that the method for identifying soft clauses in letters of credit in this application embodiment can be deployed in an electronic device, which can be a server or a terminal device.
[0043] Among them, the server can be Figure 1 The server 120 shown can also be used for output. Figure 1 Other servers besides server 120 shown. The terminal device can be... Figure 1 The terminal device 110 shown can also be used for output. Figure 1 Other terminal devices besides terminal device 110 shown.
[0044] Figure 1 The examples shown are merely illustrative; in reality, the number of terminal devices 110 and servers 120 is not limited and is not specifically limited in this embodiment.
[0045] In this embodiment of the application, when there are multiple servers 120, the multiple servers 120 can form a blockchain, and the server 120 is a node on the blockchain; as disclosed in the embodiment of the application of the letter of credit soft clause identification method, the letter of credit messages, the first soft clause set, the second soft clause set, etc. involved can be stored on the blockchain.
[0046] Based on the above application scenarios, the following describes the method for identifying letter of credit soft clauses provided by the exemplary embodiments of this application, in conjunction with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way in this respect.
[0047] refer to Figure 2 , Figure 2 An exemplary embodiment of this application provides a method for identifying soft clauses in letters of credit, which can be executed by an electronic device and includes the following steps: Step S201: Receive the letter of credit message to be processed, determine the customer object corresponding to the letter of credit message, and extract the set of soft clauses to be identified from the letter of credit message.
[0048] It should be noted that soft clauses are generally restrictive clauses, or clauses that are unclear or ambiguous, giving the issuing bank a basis for exemption from liability at any time. This is very disadvantageous to the beneficiary and needs to be identified in time, otherwise, they may face losses. Common soft clauses include: 1. Clauses that are temporarily ineffective, such as letters of credit that require further notification from the issuing bank, relevant authorization, or approval from local authorities to take effect; 2. Clauses that result in the loss of title to goods, such as one-third of the bill of lading being sent by the buyer or air waybills; 3. Clauses that require the cooperation of the importer or its related parties, such as unconventional factory inspection reports or quality inspection certificates; 4. Conditional clauses, such as requiring specific routes, vessel ages, or the submission of special types of transport documents; 5. Self-contradictory clauses, such as allowing the submission of through bills of lading but prohibiting transshipment.
[0049] The above step S201 can be specifically implemented as follows: based on historical messages, organize the face letter and letter of credit messages according to the customer dimension, and extract and mark the existing face letter and letter of credit message samples.
[0050] For example, extract the phrase "circular clause, see 47A-2" mentioned in the letter of correspondence and letter of credit messages, and mark the second paragraph of column 47A of the message as a circular clause. By doing so, all special clauses (i.e. soft clauses) of customer X and their examples can be obtained. At the same time, the letter of correspondence and letter of credit messages of different customers can be processed to obtain a full set of soft clauses and cases of soft clause types.
[0051] Step S202: For each soft clause to be identified in the set of soft clauses to be identified, perform the following operations: Using a similarity dual-tower model, perform similarity matching between the soft clause to be identified and each first soft clause in the preset first soft clause set to obtain multiple first similarities.
[0052] Each first similarity corresponds to a first soft clause, and the set of first soft clauses corresponds to a customer object.
[0053] In one possible embodiment, the present application employs the following method to train the similarity dual-tower model, including: Obtain a training sample set, which includes a sample soft clause set and a set of positive and negative candidate clauses corresponding to the sample soft clause set; Each sample soft clause in the sample soft clause set, each positive candidate clause in the positive example candidate clause set, and each negative candidate clause in the negative example candidate clause set are input into the similarity dual-tower model for training. The loss function of the constructed training similarity dual-tower model is used to ensure that the similarity between positive candidate clauses in the positive candidate clause set and negative candidate clauses in the negative candidate clause set is less than the similarity between positive candidate clauses in the positive candidate clause set and sample soft clauses in the sample soft clause set.
[0054] In another possible embodiment, the loss function of the constructed training similarity dual-tower model is also used to ensure that the similarity between positive candidate clauses in the positive candidate clause set and sample soft clauses in the sample soft clause set is greater than the similarity between negative candidate clauses in the negative candidate clause set and sample soft clauses in the sample soft clause set.
[0055] In one possible embodiment, positive candidate clauses also include soft clauses in historical letter of credit messages corresponding to different customer objects; Negative candidate clauses include non-soft clauses corresponding to the same customer in historical letter of credit messages, non-soft clauses corresponding to different customers, and non-clauses.
[0056] In one possible implementation, the training sample set is constructed using the following method: For each sample soft clause in the sample soft clause set, based on the customer object corresponding to the sample soft clause, soft clauses in historical letter of credit messages corresponding to the same customer object are identified as positive candidate clauses of the sample soft clause; Non-soft clauses in historical letter of credit messages are identified as negative candidate clauses for sample soft clauses.
[0057] In one possible embodiment, positive candidate clauses also include soft clauses in historical letter of credit messages corresponding to different customer objects; Negative candidate clauses include non-soft clauses corresponding to the same customer in historical letter of credit messages, non-soft clauses corresponding to different customers, and non-clauses.
[0058] In one possible embodiment, the structure of the similarity twin-tower model is as follows: Figure 3 As shown, the model includes an input layer, a representation layer, and a matching layer, as detailed below: (1) Input layer: Generally, there are two inputs, as shown in the following input structure: The input is divided into positive examples and negative examples. The input of two soft clauses is used as a positive example, and the input of one soft clause and one non-soft clause is used as a negative example. For positive examples, a higher matching score is better (indicating that the semantic differences between the two inputs are small): A. Input 1 - A corpus of a certain type of soft clauses from a certain customer; Input 2 - A corpus of soft clauses of the same type but different instances from a certain customer; B. Input 1 - A corpus of a certain type of soft clause from a certain customer; Input 2 - A corpus of the same type of soft clause from other customers; Counterexample: A lower matching score is better (indicating a large semantic difference between the two inputs). A. Input 1 - A customer's data on a certain type of soft clause; Input 2 - A customer's data on non-soft clauses. B. Input 1 - Data on a certain type of soft clause from a certain customer; Input 2 - Data on non-soft clauses from other customers; C. Input 1 - A certain type of soft clause data for a certain customer; Input 2 - Other non-clause data.
[0059] (2) Representation Layer: After each of the two input layers, a representation layer is connected. This representation layer transforms the original text data into numerical vectors so that the computer can understand and manipulate it. The representation layer outputs numerical vectors. The representation layer generally uses CNN and RNN models to convert the text data into numerical vectors through word embedding. Word embedding maps words in the vocabulary to a multi-dimensional vector space, so that words with similar meanings are close to each other in the vector space. Then, the CNN or RNN can receive these vectors as input and begin to perform feature extraction and sequence processing tasks.
[0060] (3) Matching layer: Cosine similarity is used as the method to calculate the similarity. The cosine similarity between the two numerical vectors output by the representation layer is calculated to obtain the matching score.
[0061] (4) Match score: Cosine similarity measures the cosine of the angle between two non-zero vectors. It reflects the consistency of the directions of the two vectors and ranges from -1 to 1. 1 indicates that the two vectors point in the same direction, which is the highest degree of similarity; 0 represents orthogonal, indicating that the two are unrelated; while -1 symbolizes the greatest difference in opposite directions.
[0062] Calculation formula: Given two vectors and Their cosine similarity can be calculated using the following formula:
[0063] in, Represents the vector dot product. and Representing vectors respectively sum vector The length of the module.
[0064] In one possible embodiment, a similarity dual-tower model is employed, performing similarity matching between the soft clause to be identified and each first soft clause in the first soft clause set, thereby obtaining multiple first similarities between the soft clause to be identified and each first soft clause. The process is as follows: Figure 4 As shown, it includes the following steps: Step S401: Use the soft clause to be identified as the first input of the similarity dual-tower model, and use each first soft clause in the first soft clause set as the second input of the similarity dual-tower model.
[0065] Step S402: Using the similarity dual-tower model, the first input is transformed into a first vector, and each second input is transformed into a second vector.
[0066] Step S403: The cosine similarity between the first vector and each second vector is used as the first similarity between the soft clause to be identified and the corresponding first soft clause.
[0067] Step S203: If any of the multiple first similarities is greater than a preset first threshold, then the soft clause to be identified and the first soft clause corresponding to any first similarity are determined to be clauses of the same category.
[0068] Step S204: If multiple first similarities are less than or equal to a preset first threshold, a similarity dual-tower model is adopted to perform similarity matching between the soft clause to be identified and each second soft clause in the preset set of second soft clauses, thereby obtaining multiple second similarities.
[0069] Each second similarity corresponds to a second soft clause, and the set of second soft clauses corresponds to multiple different customer objects. It should be noted that the set of second soft clauses is a complete set of soft clauses, including all existing soft clauses for all customers.
[0070] In one possible embodiment, a dual-tower similarity model is employed, whereby a similarity match is performed on each second soft clause in the set of soft clauses to be identified and the second soft clause, respectively, to obtain a second similarity between the soft clause to be identified and each second soft clause. The process is as follows: Figure 5 As shown, it includes the following steps: Step S501: The soft clause to be identified is used as the third input of the similarity dual-tower model, and each second soft clause in the second soft clause set is used as the fourth input of the similarity dual-tower model.
[0071] Step S502: Using the similarity dual-tower model, the third input is transformed into a third vector, and multiple fourth inputs are transformed into multiple fourth vectors.
[0072] Step S503: Determine the cosine similarity of the third vector and each of the multiple fourth vectors to obtain multiple second similarities between the soft clause to be identified and each second soft clause.
[0073] Step S205: If any of the multiple second similarities is greater than a preset second threshold, then the soft clause to be identified and the second soft clause corresponding to any second similarity are determined to be clauses of the same category.
[0074] Since customers generally have similar language and business habits when opening letters of credit, this application embodiment first groups the letter of credit messages according to the customer, and then performs semantic similarity matching on the soft clauses from the perspective of a single customer. If no match is found, semantic similarity matching is performed on the soft clauses based on all customer dimensions in the full set of soft clauses. When the similarity meets the conditions, the addition of new categories of soft clauses for that customer is realized.
[0075] Based on the foregoing description, in this embodiment of the application, customer-level processing is added during the soft clause data preparation stage. This allows the similarity dual-tower model to take into account both the semantics of general terms and the unique semantic description scenarios of each customer's terms. It also takes into account the semantic description habits of different users and uses the similarity dual-tower model to identify and classify soft clauses. This enables more accurate identification of soft clauses in letters of credit from different customers and improves the efficiency of letter of credit processing for business personnel.
[0076] Based on the same inventive concept, this application provides a credit letter of credit soft clause identification device. Please refer to... Figure 6 The device includes: a soft clause extraction unit 601, a first similarity determination unit 602, a first category determination unit 603, a second similarity determination unit 604, and a second category determination unit 605, wherein: The soft clause extraction unit 601 is configured to receive a letter of credit message to be processed, determine the customer object corresponding to the letter of credit message, and extract a set of soft clauses to be identified from the letter of credit message. For each soft clause to be identified in the set of soft clauses to be identified, perform the following operations: The first similarity determination unit 602 is configured to use a similarity dual-tower model to perform similarity matching between the soft clause to be identified and each first soft clause in a preset set of first soft clauses, thereby obtaining multiple first similarities, each first similarity corresponding to a first soft clause; the first set of soft clauses corresponds to the customer object; The first category determination unit 603 is configured to determine that the soft clause to be identified and the first soft clause corresponding to any of the multiple first similarities are of the same category if any of the first similarities is greater than a preset first threshold. The second similarity determination unit 604 is configured to, if the plurality of first similarities are less than or equal to a preset first threshold, use the similarity dual-tower model to perform similarity matching on the soft clause to be identified and each second soft clause in the preset set of second soft clauses to obtain a plurality of second similarities, each second similarity corresponding to a second soft clause; the second soft clause set corresponds to a plurality of different customer objects; The second category determination unit 605 is configured to determine that the soft clause to be identified and the second soft clause corresponding to any of the plurality of second similarities are of the same category if any of the second similarities is greater than a preset second threshold.
[0077] In one possible embodiment, a model training unit is also included, configured to train the similarity dual-tower model using the following method: Obtain a training sample set, which includes a sample soft clause set and a set of positive candidate clauses and a set of negative candidate clauses corresponding to the sample soft clause set; Each sample soft clause in the sample soft clause set, each positive candidate clause in the positive candidate clause set, and each negative candidate clause in the negative candidate clause set are respectively input into the similarity dual-tower model for training; The loss function constructed for training the similarity dual-tower model is used to ensure that the similarity between positive candidate clauses in the positive candidate clause set and negative candidate clauses in the negative candidate clause set is less than the similarity between positive candidate clauses in the positive candidate clause set and sample soft clauses in the sample soft clause set.
[0078] In one possible embodiment, the loss function constructed for training the similarity dual-tower model is further used to ensure that the similarity between positive candidate clauses in the positive candidate clause set and sample soft clauses in the sample soft clause set is greater than the similarity between negative candidate clauses in the negative candidate clause set and sample soft clauses in the sample soft clause set.
[0079] In one possible embodiment, the model training unit is further configured to construct a training sample set using the following method: For each sample soft clause in the sample soft clause set, based on the customer object corresponding to the sample soft clause, soft clauses in historical letter of credit messages corresponding to the same customer object are determined as positive candidate clauses of the sample soft clause; Non-soft clauses in historical letter of credit messages are identified as negative candidate clauses for the sample soft clauses.
[0080] In one possible embodiment, the positive candidate clauses also include soft clauses in the historical letter of credit messages corresponding to different customer objects; The negative candidate clauses include non-soft clauses corresponding to the same customer, non-soft clauses corresponding to different customers, and non-clauses in the historical letter of credit messages.
[0081] In one possible embodiment, the similarity dual-tower model is adopted to perform similarity matching on the soft clause to be identified and each first soft clause in the first soft clause set, thereby obtaining multiple first similarities between the soft clause to be identified and each first soft clause. The first similarity determination unit 602 is specifically configured as follows: The soft clause to be identified is used as the first input of the similarity dual-tower model, and each first soft clause in the first soft clause set is used as the second input of the similarity dual-tower model. The similarity dual-tower model transforms the first input into a first vector and each second input into a second vector. The cosine similarity between the first vector and each of the second vectors is used as the first similarity between the soft clause to be identified and the corresponding first soft clause.
[0082] In one possible embodiment, the similarity dual-tower model is used to perform similarity matching on each second soft clause in the set of soft clauses to be identified and the second soft clauses, respectively, to obtain a second similarity between the soft clause to be identified and each second soft clause. The second similarity determination unit 604 is specifically configured as follows: The soft clause to be identified is used as the third input of the similarity dual-tower model, and each second soft clause in the second soft clause set is used as the fourth input of the similarity dual-tower model. The similarity dual-tower model transforms the third input into a third vector and the multiple fourth inputs into multiple fourth vectors. The cosine similarity between the third vector and each of the plurality of fourth vectors is determined to obtain a plurality of second similarities between the soft clause to be identified and each of the second soft clauses.
[0083] The letter of credit soft clause identification device provided in this application embodiment and the letter of credit soft clause identification method in the above embodiment have the same beneficial effects, and will not be described in detail here.
[0084] After introducing the letter of credit soft clause identification method and device according to exemplary embodiments of this application, the electronic device provided according to embodiments of this application will be introduced next.
[0085] Based on the same inventive concept, this application provides an electronic device that can realize the function of the letter of credit soft clause identification method discussed above. Please refer to... Figure 7 The device includes a processor 701 and a memory 702.
[0086] The processor 701 may include one or more central processing units (CPUs) or digital processing units, etc. The processor 701 is used to implement the letter of credit soft clause identification method in the above embodiments when it calls the computer program stored in the memory 702.
[0087] The memory 702 is used to store computer programs executed by the processor 701. The memory 702 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and programs required to run instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0088] Memory 7021 can be volatile memory, such as random-access memory (RAM); memory 7021 can also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 702 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 701 can be a combination of the above-mentioned memories.
[0089] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium. The computer program product includes computer program code, which, when executed on a computer, causes the computer to perform any of the letter of credit soft clause identification methods discussed above. Since the principle by which the above-described computer-readable storage medium solves the problem is similar to that of the letter of credit soft clause identification method, the implementation of the above-described computer-readable storage medium can be referred to the implementation of the method, and repeated details will not be elaborated further.
[0090] Based on the same inventive concept, this application also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it causes the computer to execute any of the letter of credit soft clause identification methods discussed above. Since the principle of the above computer program product in solving the problem is similar to that of the letter of credit soft clause identification method, the implementation of the above computer program product can refer to the implementation of the method, and repeated details will not be repeated.
[0091] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0092] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0093] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0094] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of user-operated steps to be executed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0095] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for identifying soft clauses in letters of credit, characterized in that, The method includes: Receive a letter of credit message to be processed, determine the customer object corresponding to the letter of credit message, and extract the set of soft clauses to be identified from the letter of credit message; For each soft clause to be identified in the set of soft clauses to be identified, perform the following operations: A similarity dual-tower model is adopted to perform similarity matching between the soft clause to be identified and each first soft clause in the preset first soft clause set, resulting in multiple first similarities, each first similarity corresponding to one first soft clause; the first soft clause set corresponds to the customer object; If any of the plurality of first similarities is greater than a preset first threshold, then the soft clause to be identified and the first soft clause corresponding to any of the first similarities are determined to be clauses of the same category. If the multiple first similarities are less than or equal to a preset first threshold, then the similarity dual-tower model is used to perform similarity matching between the soft clause to be identified and each second soft clause in the preset set of second soft clauses, to obtain multiple second similarities, each second similarity corresponding to a second soft clause; the second soft clause set corresponds to multiple different customer objects; If any of the plurality of second similarities is greater than a preset second threshold, then the soft clause to be identified and the second soft clause corresponding to any of the second similarities are determined to be clauses of the same category.
2. The method according to claim 1, characterized in that, The similarity dual-tower model was trained using the following method: Obtain a training sample set, which includes a sample soft clause set and a set of positive candidate clauses and a set of negative candidate clauses corresponding to the sample soft clause set; Each sample soft clause in the sample soft clause set, each positive candidate clause in the positive candidate clause set, and each negative candidate clause in the negative candidate clause set are respectively input into the similarity dual-tower model for training; The loss function constructed for training the similarity dual-tower model is used to ensure that the similarity between positive candidate clauses in the positive candidate clause set and negative candidate clauses in the negative candidate clause set is less than the similarity between positive candidate clauses in the positive candidate clause set and sample soft clauses in the sample soft clause set.
3. The method according to claim 2, characterized in that, The loss function constructed for training the similarity dual-tower model is also used to ensure that the similarity between the positive candidate clauses in the positive candidate clause set and the sample soft clauses in the sample soft clause set is greater than the similarity between the negative candidate clauses in the negative candidate clause set and the sample soft clauses in the sample soft clause set.
4. The method according to claim 1, characterized in that, The training sample set is constructed using the following method: For each sample soft clause in the sample soft clause set, based on the customer object corresponding to the sample soft clause, soft clauses in historical letter of credit messages corresponding to the same customer object are determined as positive candidate clauses of the sample soft clause; Non-soft clauses in historical letter of credit messages are identified as negative candidate clauses for the sample soft clauses.
5. The method according to claim 4, characterized in that, The positive candidate clauses also include soft clauses in the historical letter of credit messages corresponding to different customer objects; The negative candidate clauses include non-soft clauses corresponding to the same customer, non-soft clauses corresponding to different customers, and non-clauses in the historical letter of credit messages.
6. The method according to claim 1, characterized in that, The method employs a dual-tower similarity model, performing similarity matching between the soft clause to be identified and each first soft clause in the first soft clause set, to obtain multiple first similarities between the soft clause to be identified and each first soft clause, including: The soft clause to be identified is used as the first input of the similarity dual-tower model, and each first soft clause in the first soft clause set is used as the second input of the similarity dual-tower model. The similarity dual-tower model transforms the first input into a first vector and each second input into a second vector. The cosine similarity between the first vector and each of the second vectors is used as the first similarity between the soft clause to be identified and the corresponding first soft clause.
7. The method according to claim 1, characterized in that, The method employs the dual-tower similarity model to perform similarity matching on each second soft clause in the set of soft clauses to be identified and the second soft clauses, thereby obtaining a second similarity between the soft clause to be identified and each second soft clause, including: The soft clause to be identified is used as the third input of the similarity dual-tower model, and each second soft clause in the second soft clause set is used as the fourth input of the similarity dual-tower model. The similarity dual-tower model transforms the third input into a third vector and the multiple fourth inputs into multiple fourth vectors. The cosine similarity between the third vector and each of the plurality of fourth vectors is determined to obtain a plurality of second similarities between the soft clause to be identified and each of the second soft clauses.
8. A device for identifying soft clauses in letters of credit, characterized in that, The device includes: The soft clause extraction unit is configured to receive a letter of credit message to be processed, determine the customer object corresponding to the letter of credit message, and extract a set of soft clauses to be identified from the letter of credit message. For each soft clause to be identified in the set of soft clauses to be identified, perform the following operations: The first similarity determination unit is configured to use a similarity dual-tower model to perform similarity matching between the soft clause to be identified and each first soft clause in a preset set of first soft clauses, thereby obtaining multiple first similarities, each first similarity corresponding to a first soft clause; the first set of soft clauses corresponds to the customer object; The first category determination unit is configured to determine that the soft clause to be identified and the first soft clause corresponding to any of the multiple first similarities are of the same category if any of the first similarities is greater than a preset first threshold. The second similarity determination unit is configured to, if the plurality of first similarities are less than or equal to a preset first threshold, use the similarity dual-tower model to perform similarity matching on the soft clause to be identified and each second soft clause in the preset set of second soft clauses to obtain a plurality of second similarities, each second similarity corresponding to a second soft clause; the second soft clause set corresponds to a plurality of different customer objects; The second category determination unit is configured to determine that the soft clause to be identified and the second soft clause corresponding to any of the plurality of second similarities are of the same category if any of the second similarities is greater than a preset second threshold.
9. An electronic device, characterized in that, include: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the credit soft clause identification method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the credit soft clause identification method as described in any one of claims 1-7.