Transaction data labeling method, fraud classification model training method and device
By extracting the feature vectors of fraud description information using a large language model and inputting it into a pre-trained fraud classification model, the annotation of transaction data is automatically completed, which solves the problem of low manual labeling efficiency and achieves a more efficient and accurate labeling process.
Patent Information
- Application Number
- CN202411853827.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-03-18
AI Technical Summary
In the prior art, manual annotation of transaction data is used, resulting in low labeling efficiency.
By obtaining the target transaction data and its corresponding fraud description information, a large language model is used to extract the fraud description information, obtain the fraud feature vector, and input it into the pre-trained fraud classification model to obtain the target fraud type identification as the label of the transaction data.
No manual annotation is required, which improves the efficiency of transaction data annotation and enhances the accuracy of the annotation.
Smart Images

Figure CN119646522A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a transaction data labeling method, a fraud classification model training method and a device. Background Art
[0002] With the development of the financial industry and the advancement of technology, the results of identifying whether transaction data contains fraud are becoming more and more accurate. Transaction data is usually input into a fraud identification model to determine whether the transaction data contains fraud. In order to further improve the accuracy of identification, transaction data can also be input into a fraud type identification model to determine the fraud type of the transaction data.
[0003] In the prior art, in order to train a fraud type recognition model, it is necessary to label the transaction data with the fraud type, and then train the model after forming the training data. The labels for labeling transaction data are usually labeled by staff based on their own experience.
[0004] In summary, the existing technology uses manual methods to label transaction data, resulting in low labeling efficiency. Summary of the invention
[0005] The present application provides a transaction data labeling method, a fraud classification model training method and a device, so as to solve the problem of low labeling efficiency caused by manually labeling transaction data in the prior art.
[0006] In a first aspect, the present application provides a method for labeling transaction data, comprising:
[0007] Obtaining target transaction data and fraud description information corresponding to the target transaction data;
[0008] Using a large language model to extract features from the fraud description information to obtain a fraud feature vector;
[0009] Inputting the fraud feature vector into a fraud classification model to obtain a target fraud type identifier; the fraud classification model is a pre-trained federated machine learning model that determines the fraud type identifier based on the feature vector;
[0010] The target fraud type identifier is used as a label of the target transaction data.
[0011] In a second aspect, the present application provides a fraud classification model training method, which is applied to a training device, and the method comprises:
[0012] Receiving sample data sent by sample generation devices of multiple transaction institutions, each of the sample data includes a training fraud feature vector and a fraud type identifier;
[0013] The fraud type identifier in each of the sample data is used as a label, and the initial federated machine learning model is trained according to the fraud training feature vector in each of the sample data to obtain a fraud classification model. The fraud classification model is used to determine the fraud type identifier based on the feature vector.
[0014] In a third aspect, the present application provides a fraud classification model training method, which is applied to a sample generation device of a trading institution, and the method comprises:
[0015] Determine a reference vector corresponding to each fraud type;
[0016] Determine at least one sample data according to the reference vector corresponding to each fraud type and the training fraud description information corresponding to at least one training transaction data; each of the sample data includes a training fraud feature vector and a fraud type identifier, and each of the sample data is used to perform model training on the initial federated machine learning model to obtain a fraud classification model, and the fraud classification model is used to determine the fraud type identifier according to the feature vector;
[0017] Each of the sample data is sent to a training device.
[0018] In a fourth aspect, the present application provides a transaction data labeling device, comprising:
[0019] An acquisition module, used to acquire target transaction data and fraud description information corresponding to the target transaction data;
[0020] Processing modules for:
[0021] Using a large language model to extract features from the fraud description information to obtain a fraud feature vector;
[0022] Inputting the fraud feature vector into a fraud classification model to obtain a target fraud type identifier; the fraud classification model is a pre-trained federated machine learning model that determines the fraud type identifier based on the feature vector;
[0023] The target fraud type identifier is used as a label of the target transaction data.
[0024] In a fifth aspect, the present application provides a fraud classification model training device, comprising:
[0025] A receiving module, used to receive sample data sent by sample generation devices of multiple transaction institutions, each of the sample data includes a training fraud feature vector and a fraud type identifier;
[0026] The model training module is used to use the fraud type identifier in each sample data as a label, and train the initial federated machine learning model according to the fraud training feature vector in each sample data to obtain a fraud classification model, wherein the fraud classification model is used to determine the fraud type identifier according to the feature vector.
[0027] In a sixth aspect, the present application provides a fraud classification model training device, comprising:
[0028] Processing modules for:
[0029] Determine a reference vector corresponding to each fraud type;
[0030] Determine at least one sample data according to the reference vector corresponding to each fraud type and the training fraud description information corresponding to at least one training transaction data; each of the sample data includes a training fraud feature vector and a fraud type identifier, and each of the sample data is used to perform model training on the initial federated machine learning model to obtain a fraud classification model, and the fraud classification model is used to determine the fraud type identifier according to the feature vector;
[0031] The sending module is used to send each of the sample data to the training device.
[0032] In a seventh aspect, the present application provides an electronic device, including:
[0033] Processor, memory, communication interface;
[0034] The memory is used to store executable instructions of the processor;
[0035] Wherein, the processor is configured to execute the transaction data labeling method described in the first aspect, or execute the fraud classification model training method described in any one of the second aspect or the third aspect, by executing the executable instructions.
[0036] In an eighth aspect, the present application provides a readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the transaction data labeling method described in the first aspect is implemented, or the fraud classification model training method described in any one of the second aspect or the third aspect is implemented.
[0037] In a ninth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, is used to implement the transaction data labeling method described in the first aspect, or to implement the fraud classification model training method described in any one of the second aspect or the third aspect.
[0038] The transaction data labeling method, fraud classification model training method and device provided by the present application obtain target transaction data and its corresponding fraud description information, then use a large language model to extract features from the fraud description information to obtain a fraud feature vector; then input the fraud feature vector into the fraud classification model, obtain the target fraud type identifier, and use the target fraud type identifier as the label of the target transaction data to achieve the labeling of the transaction data. This solution labels the target transaction data by using fraud description information and a fraud classification model, without the need for manual labeling, and effectively improves the labeling efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0040] Figure 1 A schematic diagram of the generation process of the anti-fraud model in the prior art provided for this application;
[0041] Figure 2a A flowchart of a first embodiment of a method for marking transaction data provided by the present application;
[0042] Figure 2b A schematic diagram of the generation process of the fraud type identification model provided for this application;
[0043] Figure 3 A flowchart of the first embodiment of the fraud classification model training method provided in this application;
[0044] Figure 4 A flowchart of the second embodiment of the fraud classification model training method provided in this application;
[0045] Figure 5 A flowchart of the third embodiment of the fraud classification model training method provided in this application;
[0046] Figure 6 A flowchart of the fourth embodiment of the fraud classification model training method provided in this application;
[0047] Figure 7 A schematic diagram of the structure of an embodiment of a transaction data labeling device provided in this application;
[0048] Figure 8 A schematic diagram of the structure of the first embodiment of the fraud classification model training device provided in the present application;
[0049] Fig. 9 A structural diagram of Embodiment 2 of the fraud classification model training device provided in this application;
[0050] Fig.10A schematic diagram of the structure of an electronic device provided in this application.
[0051] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0052] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0053] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0054] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0055] In addition, this application involves conducting big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.), and using artificial intelligence technology to make automated decisions, and making technical solutions that have a significant impact on personal rights and interests based on the results of automated decisions. The application provides users with corresponding operation entrances for them to choose to agree or reject the results of automated decisions; if the user chooses to reject, the expert decision-making process will be entered.
[0056] It should be noted that the transaction data labeling method, fraud classification model training method and device provided in the present application can be used in the field of artificial intelligence, and can also be used in any field other than artificial intelligence. The application field of the transaction data labeling method, fraud classification model training method and device in the present application is not limited.
[0057] With the development of technology, anti-fraud models can be used not only to identify whether transaction data contains fraud, but also to determine the type of fraud. Transaction data is input into the fraud type identification model to determine the fraud type of the transaction data.
[0058] For example, Figure 1 A schematic diagram of the generation process of the anti-fraud model in the prior art provided in this application, such as Figure 1 As shown in the figure, a label indicating whether there is fraud is added to the transaction data, and after obtaining sample data, it is input into the binary classification model for training to obtain an anti-fraud model. The anti-fraud model can only identify whether there is fraud in the transaction data.
[0059] In the prior art, in order to train a fraud type recognition model, it is necessary to label the transaction data with the fraud type, and then train the model after forming the training data. For labeling the transaction data, staff with strong professional knowledge usually analyze the transaction data and then label it. Since the transaction data is labeled manually, the labeling efficiency is low.
[0060] In view of the problems existing in the prior art, the inventor discovered in the process of studying the transaction data labeling method that fraudulent transaction data has corresponding fraud description information, and sample data can be generated based on the fraud description information, and then the sample data is used to train the initial federated machine learning model to obtain a fraud classification model. In this way, when labeling transaction data, the fraud feature vector can be first determined based on the fraud description information corresponding to the target transaction data, and then the fraud feature vector can be input into the fraud classification model to obtain the target fraud type identifier, and finally the target fraud type identifier is used as the label of the target transaction data to complete the labeling of the target transaction data, thereby improving the labeling efficiency. Based on the above-mentioned inventive concept, a labeling scheme for transaction data in this application is designed.
[0061] The following is an example of an application scenario of the method for labeling transaction data provided by the application.
[0062] For example, in this application scenario, it is necessary to generate a fraud type identification model in order to process transaction data and reduce the occurrence of fraud.
[0063] In order to obtain a fraud type recognition model, the target transaction data needs to be labeled, and then the labeled target transaction data is used for model training to obtain a fraud type recognition model.
[0064] First, the target transaction data and its corresponding fraud description information are obtained, and then a large language model is used to extract features of the fraud description information to obtain a fraud feature vector.
[0065] Since a fraud classification model has been generated before, which is obtained by training the initial federated machine learning model based on sample data generated by sample generation devices of multiple trading institutions, the fraud feature vector is input into the fraud classification model to obtain the target fraud type identification.
[0066] Finally, the target fraud type identifier is used as the label of the target transaction data to complete the labeling of the target transaction data.
[0067] It should be noted that the above scenario is only an example of an application scenario provided in an embodiment of the present application, and in the specific application of the solution, it can be set according to actual needs.
[0068] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0069] Figure 2a The flowchart of the first embodiment of the transaction data labeling method provided in the present application is as follows. The execution subject of the embodiment of the transaction data labeling method in the present application can be a server, a computer, a terminal device, etc., and the following description is made using a computer as an example. The present application embodiment describes the situation where a computer labels target transaction data according to the fraud description information corresponding to the target transaction data and the fraud classification model. The method in this embodiment can be implemented by software, hardware, or a combination of software and hardware. Figure 2a As shown, the transaction data marking method specifically includes the following steps:
[0070] S201: Obtain target transaction data and fraud description information corresponding to the target transaction data.
[0071] In this step, in order to label the target transaction data, it is necessary to obtain the target transaction data and the fraud description information corresponding to the target transaction data.
[0072] It should be noted that the transaction data and target transaction data are data in the transaction process, including the transaction subject, transaction type, transaction amount, transaction time, etc. The embodiment of the present application does not limit the transaction data and target transaction data, and can be determined according to actual conditions.
[0073] It should be noted that the fraud description information corresponding to the target transaction data is relevant information about the fraud involved in the target transaction data, including fraud time description, fraud reason, fraud type, fraud amount, etc. The embodiment of the present application does not limit the fraud description information, which can be determined according to actual conditions.
[0074] S202: Use a large language model to extract features from the fraud description information to obtain a fraud feature vector.
[0075] In this step, after the computer obtains the fraud description information, in order to be able to use the fraud classification model later, it is necessary to use a large language model to extract features from the fraud description information to obtain a fraud feature vector.
[0076] S203: Input the fraud feature vector into the fraud classification model to obtain a target fraud type identifier.
[0077] In this step, after the computer obtains the fraud feature vector, since the fraud classification model is a pre-trained federated machine learning model that determines the fraud type identification based on the feature vector, the fraud feature vector can be input into the fraud classification model to obtain the target fraud type identification.
[0078] It should be noted that the fraud classification model can be a horizontal federated machine learning model, and the input of the model is a feature vector, which does not involve the original fraud description information. Therefore, any trading institution can use the model to annotate transaction data without leaking transaction data and fraud description information.
[0079] S204: Use the target fraud type identifier as a label for the target transaction data.
[0080] In this step, after the computer obtains the target fraud type identifier, it can mark it, that is, use the target fraud type identifier as a label for the target transaction data.
[0081] After the computer uses the transaction data labeling method to label multiple target transaction data, it can obtain normal transaction data without fraud, and label these normal transaction data with normal transaction identification labels, and then use the labeled target transaction data and normal transaction data as training data to train the multi-classification model to obtain a fraud type recognition model. When the fraud type needs to be identified later, the transaction data to be identified is input into the fraud type recognition model to determine whether the transaction data to be identified is fraudulent, and when fraud is present, the fraud type can be determined.
[0082] For example, Figure 2b A schematic diagram of the generation process of the fraud type identification model provided for this application is as follows: Figure 2b As shown, the target transaction data marked with the target fraud type identifier and the normal transaction data marked with the normal transaction identifier are used to train the multi-classification model to obtain a fraud type recognition model. Using the multi-classification model for model training can improve the accuracy of the fraud type recognition model.
[0083] The transaction data labeling method provided in this embodiment obtains the target transaction data and its corresponding fraud description information, and then uses a large language model to extract features from the fraud description information to obtain a fraud feature vector; then the fraud feature vector is input into a fraud classification model to obtain a target fraud type identifier, and then the target fraud type identifier is used as a label for the target transaction data to achieve the labeling of the transaction data. This solution labels the target transaction data by using fraud description information and a fraud classification model, without the need for manual labeling, which effectively improves the labeling efficiency and the labeling accuracy.
[0084] Figure 3 This is a flowchart of the first embodiment of the fraud classification model training method provided in this application. The execution subjects of the embodiment of the fraud classification model training method in this application are the training device and the sample generation device of the transaction institution. The training device and the sample generation device can be a server, a computer, a terminal device, etc. Based on the above embodiments, this embodiment of the application describes the situation where the training device performs model training based on the sample data sent by the sample generation device. Figure 3 As shown, the fraud classification model training method specifically includes the following steps:
[0085] S301: receiving sample data sent by sample generation devices of multiple trading institutions.
[0086] In order to ensure that transaction data and fraud description information will not be leaked, the sample generation device of each transaction institution needs to generate sample data based on the training fraud description information corresponding to the training transaction data. The sample data includes the training fraud feature vector and the fraud type identifier, not the transaction data and fraud description information. Then the training device performs model training based on the sample data to obtain a fraud classification model, which is used to determine the fraud type identifier based on the feature vector.
[0087] In this step, after the sample generation device of each trading institution sends the sample data to the training device, the training device can receive the sample data sent by the sample generation devices of multiple trading institutions.
[0088] S302: The fraud type identifier in each sample data is used as a label, and the initial federated machine learning model is trained according to the fraud training feature vector in each sample data to obtain a fraud classification model.
[0089] In this step, after the training device obtains the sample data, it uses the fraud type identifier in each sample data as a label, and performs model training on the initial federated machine learning model based on the fraud training feature vector in each sample data to obtain a fraud classification model.
[0090] Specifically, the training device selects a sample data from a plurality of sample data, and then inputs a fraud training feature vector in the sample data into an initial federated machine learning model to obtain a training fraud type identifier.
[0091] The loss value is calculated based on the training fraud type identifier and the fraud type identifier in the sample data, and then the initial federated machine learning model is updated based on the loss value to obtain a trained model.
[0092] Update the number of training times, that is, add one to the number of training times.
[0093] If the updated number of training times is not equal to the preset training times threshold, then select a new sample data from the multiple sample data, and then input the fraud training feature vector in the sample data into the trained model to obtain a new training fraud type identifier. According to the new training fraud type identifier and the fraud type identifier in the new sample data, calculate the new loss value, and then update the trained model according to the new loss value to obtain a new trained model. Update the number of training times. If the updated number of training times is not equal to the preset training times threshold, repeat this process until the updated number of training times is equal to the preset training times threshold, and use the new trained model as the fraud classification model.
[0094] It should be noted that the preset training times threshold may be 500, 5000, 10000, 50000, etc. The embodiment of the present application does not limit the preset training times threshold, which may be determined according to actual conditions.
[0095] The fraud classification model training method provided in this embodiment uses sample data sent by sample generation devices of multiple transaction institutions to train the initial federated machine learning model to obtain a fraud classification model. This method can achieve model training without leaking transaction data and fraud description information, thereby improving data security while also improving the accuracy of the fraud classification model.
[0096] In addition, using sample data generated by sample generation devices of multiple transaction institutions can increase the amount of sample data and further improve the accuracy of the fraud classification model.
[0097] Figure 4 This is a flow chart of the second embodiment of the fraud classification model training method provided by this application. Based on the above embodiment, this embodiment of the application describes the situation in which the sample generation device generates sample data according to the reference vector corresponding to each fraud type and the training fraud description information. Figure 4 As shown, the fraud classification model training method specifically includes the following steps:
[0098] S401: Determine a reference vector corresponding to each fraud type.
[0099] In this step, in order to generate sample data, the sample generation device needs to first determine the reference vector corresponding to each fraud type.
[0100] In one implementation, the sample generation device obtains a reference vector corresponding to each fraud type. The method of obtaining may be: other sample generation devices send the reference vector corresponding to each fraud type to the sample generation device, and the sample generation device can obtain the reference vector corresponding to each fraud type. It can also be: the sample generation device obtains the reference vector corresponding to each fraud type from a third-party platform. It can also be: the staff inputs the reference vector corresponding to each fraud type into the sample generation device, and the sample generation device can obtain the reference vector corresponding to each fraud type. The embodiment of the present application does not limit the method for the sample generation device to obtain the reference vector, which can be determined according to actual conditions.
[0101] In another implementation, the sample generation device may generate a reference vector corresponding to each fraud type according to the training fraud description information corresponding to at least one training transaction data. Generating the reference vector according to the training fraud description information may improve the matching degree between the reference vector and the fraud type.
[0102] S402: Determine at least one sample data according to the reference vector corresponding to each fraud type and the training fraud description information corresponding to at least one training transaction data.
[0103] In this step, after the sample generation device determines the reference vector corresponding to each fraud type, it determines at least one sample data according to the reference vector corresponding to each fraud type and the training fraud description information corresponding to at least one training transaction data.
[0104] Each sample data includes a training fraud feature vector and a fraud type identifier. Each sample data is used to train the initial federated machine learning model to obtain a fraud classification model. The fraud classification model is used to determine the fraud type identifier based on the feature vector.
[0105] Specifically, a large language model is used to extract features from each training fraud description information to obtain a fraud training feature vector corresponding to each training fraud description information.
[0106] Then, based on the reference vector corresponding to each fraud type and the fraud training feature vector corresponding to each training fraud description information, the target training fraud description information and the fraud type identifier corresponding to each target training fraud description information are determined.
[0107] That is, each fraud type is processed as follows:
[0108] Among all the training fraud description information, the training fraud description information whose cosine distance between the fraud training feature vector and the reference vector corresponding to the fraud type is less than the preset screening threshold is used as the target training fraud description information. The smaller the cosine distance between the fraud training feature vector of the training fraud description information and the reference vector corresponding to a fraud type, the higher the matching degree between the training fraud description information and the fraud type.
[0109] The fraud type identifier of the fraud type is then used as the fraud type identifier corresponding to the target training fraud description information.
[0110] It should be noted that the preset screening threshold may be 0.1, 0.2, 0.3, etc. The embodiment of the present application does not limit the preset screening threshold, which may be determined according to actual conditions.
[0111] After the sample generating device determines the fraud type identifier corresponding to the target training fraud description information, for each target training fraud description information, the fraud type identifier and the fraud training feature vector corresponding to the target training fraud description information are used as sample data.
[0112] S403: Send each sample data to the training device.
[0113] In this step, after the sample generation device generates sample data, in order to train a fraud classification model, the sample data needs to be sent to a training device so that the training device can train the initial federated machine learning model based on the sample data to obtain a fraud classification model.
[0114] The fraud classification model training method provided in this embodiment uses reference vectors corresponding to fraud types to screen training fraud description information, so that the screened target training fraud description information has a higher matching degree with the fraud type, thereby improving the accuracy of sample data.
[0115] Figure 5 This is a flow chart of the third embodiment of the fraud classification model training method provided by this application. Based on the above embodiments, this embodiment of the application describes the situation where the sample generation device generates sample data and the training device performs model training based on the sample data. Figure 5 As shown, the fraud classification model training method specifically includes the following steps:
[0116] S501: The sample generating device determines a reference vector corresponding to each fraud type.
[0117] S502: The sample generating device determines at least one sample data according to the reference vector corresponding to each fraud type and the training fraud description information corresponding to at least one training transaction data.
[0118] S503: The sample generating device sends each sample data to the training device.
[0119] It should be noted that step S501 to step S503 are similar to the implementation process of the second embodiment of the fraud classification model training method, and will not be repeated here.
[0120] S504: After the training device receives the sample data sent by the sample generation devices of multiple trading institutions, it uses the fraud type identifier in each sample data as a label, and performs model training on the initial federated machine learning model based on the fraud training feature vector in each sample data to obtain a fraud classification model.
[0121] It should be noted that step S504 is similar to the implementation process of the first embodiment of the fraud classification model training method, and will not be described in detail here.
[0122] The fraud classification model training method provided in this embodiment uses reference vectors corresponding to fraud types to screen training fraud description information, so that the screened target training fraud description information has a higher matching degree with the fraud type, thereby improving the accuracy of sample data.
[0123] In addition, by using sample data sent by sample generation devices of multiple trading institutions, the initial federated machine learning model is trained to obtain a fraud classification model. This allows model training to be performed without leaking transaction data and fraud description information, thereby improving data security while also improving the accuracy of the fraud classification model.
[0124] Figure 6 This is a flow chart of the fourth embodiment of the fraud classification model training method provided by the present application. Based on the above embodiment, the present embodiment of the present application describes the case where the sample generation device generates a reference vector corresponding to each fraud type according to the training fraud description information corresponding to at least one training transaction data. Figure 6 As shown, the fraud classification model training method specifically includes the following steps:
[0125] S601: Using a large language model to perform keyword extraction processing on each training fraud description information, to obtain keywords corresponding to each training fraud description information.
[0126] In this step, in order to determine the reference vector corresponding to each fraud type, the sample generation device first uses a large language model to perform keyword extraction processing on each training fraud description information to obtain the keyword corresponding to each training fraud description information.
[0127] In one implementation, a large language model may be used to directly perform keyword extraction processing on each training fraud description information to obtain keywords corresponding to each training fraud description information.
[0128] In another implementation, a large language model is used to extract a summary of each training fraud description information to obtain a fraud summary corresponding to each training fraud description information; and then a large language model is used to extract keywords from the fraud summary corresponding to each training fraud description information to obtain keywords corresponding to each training fraud description information. By first generating a fraud summary and then extracting keywords, the matching degree between keywords and fraud description information can be improved.
[0129] It should be noted that if the number of keywords corresponding to the training fraud description information is greater than the preset keyword threshold, since the keywords corresponding to the training fraud description information are arranged in descending order according to the degree of match with the training fraud description information, the preset keyword threshold number of keywords can be selected for subsequent steps. The preset keyword threshold can be 2, 3, 5, etc. The embodiment of the present application does not limit the preset keyword threshold, which can be determined according to actual conditions.
[0130] S602: For each fraud type, according to the keywords corresponding to each training fraud description information, determine the target description information matching the fraud type from all the training fraud description information.
[0131] In this step, after the sample generation device obtains the keywords corresponding to each training fraud description information, for each fraud type, according to the keywords corresponding to each training fraud description information, the target description information matching the fraud type is determined from all the training fraud description information.
[0132] If the keyword corresponding to a training fraud description information includes the fraud type, the training fraud description information is used as the target description information matching the fraud type.
[0133] Exemplarily, the keywords corresponding to the training fraud description information are A, B, C, and D, and the fraud types are A, B, K, and L respectively. Then the training fraud description information is the target description information that matches fraud type A, and is also the target description information that matches fraud type B.
[0134] It should be noted that if a fraud type does not have matching target description information, the fraud type can be deleted.
[0135] S603: For each fraud type, a large language model is used to extract features of each target description information matching the fraud type, and a reference feature vector corresponding to each target description information is obtained.
[0136] In this step, after the sample generation device determines the target description information that matches each fraud type, for each fraud type, a large language model is used to extract features of each target description information that matches the fraud type to obtain a reference feature vector corresponding to each target description information.
[0137] S604: For each fraud type, an average value of the reference feature vectors corresponding to each target description information matching the fraud type is used as a reference vector corresponding to the fraud type.
[0138] In this step, after the sample generation device determines the reference feature vector corresponding to the target description information, for each fraud type, the average value of the reference feature vectors corresponding to each target description information matching the fraud type is used as the reference vector corresponding to the fraud type.
[0139] It should be noted that, when the sample generating device determines the reference vector by generating a reference vector corresponding to each fraud type based on training fraud description information corresponding to at least one training transaction data, when generating sample data, it is also possible to use the fraud type identifier of the fraud type and the reference feature corresponding to the target description information as sample data for each target description information matching each fraud type.
[0140] The fraud classification model training method provided in this embodiment determines the reference vector by using the characteristic vector of each target description information matching the fraud type, so that the reference vector can better reflect the fraud type and improves the accuracy of the reference vector.
[0141] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0142] Figure 7 A schematic diagram of the structure of an embodiment of a transaction data annotation device provided in this application; Figure 7 As shown, the transaction data marking device 70 includes:
[0143] An acquisition module 71, used to acquire target transaction data and fraud description information corresponding to the target transaction data;
[0144] The processing module 72 is used to:
[0145] Using a large language model to extract features from the fraud description information to obtain a fraud feature vector;
[0146] Inputting the fraud feature vector into a fraud classification model to obtain a target fraud type identifier; the fraud classification model is a pre-trained federated machine learning model that determines the fraud type identifier based on the feature vector;
[0147] The target fraud type identifier is used as a label of the target transaction data.
[0148] The transaction data marking device provided in this embodiment is used to execute the technical solution in any of the aforementioned transaction data marking method embodiments, and its implementation principle and technical effects are similar and will not be repeated here.
[0149] Figure 8 This is a schematic diagram of the structure of the first embodiment of the fraud classification model training device provided in this application; the device can be integrated into the training device in the above-mentioned fraud classification model training method embodiment, and can also be implemented by the training device in the above-mentioned fraud classification model training method embodiment. Figure 8 As shown, the fraud classification model training device 80 includes:
[0150] A receiving module 81, used to receive sample data sent by sample generation devices of multiple transaction institutions, each of which includes a training fraud feature vector and a fraud type identifier;
[0151] The model training module 82 is used to use the fraud type identifier in each of the sample data as a label, and to train the initial federated machine learning model according to the fraud training feature vector in each of the sample data to obtain a fraud classification model, wherein the fraud classification model is used to determine the fraud type identifier based on the feature vector.
[0152] The transaction data labeling device provided in this embodiment is used to execute the technical solution of the training device in any of the aforementioned fraud classification model training method embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0153] Fig. 9 This is a schematic diagram of the structure of the second embodiment of the fraud classification model training device provided in this application; the device can be integrated into the sample generation device in the above-mentioned fraud classification model training method embodiment, and can also be implemented by the sample generation device in the above-mentioned fraud classification model training method embodiment. Fig. 9 As shown, the fraud classification model training device 90 includes:
[0154] The processing module 91 is used for:
[0155] Determine a reference vector corresponding to each fraud type;
[0156] Determine at least one sample data according to the reference vector corresponding to each fraud type and the training fraud description information corresponding to at least one training transaction data; each of the sample data includes a training fraud feature vector and a fraud type identifier, and each of the sample data is used to perform model training on the initial federated machine learning model to obtain a fraud classification model, and the fraud classification model is used to determine the fraud type identifier according to the feature vector;
[0157] The sending module 92 is used to send each of the sample data to the training device.
[0158] Furthermore, the processing module 91 is specifically used for:
[0159] Using a large language model to extract features from each of the training fraud description information, respectively, to obtain a fraud training feature vector corresponding to each of the training fraud description information;
[0160] Determine target training fraud description information and a fraud type identifier corresponding to each target training fraud description information according to a reference vector corresponding to each fraud type and a fraud training feature vector corresponding to each training fraud description information;
[0161] For each target training fraud description information, the fraud type identifier and the fraud training feature vector corresponding to the target training fraud description information are used as sample data.
[0162] Furthermore, the processing module 91 is specifically used for:
[0163] For each of the fraud types, the following processing is performed:
[0164] Among all the training fraud description information, the training fraud description information whose cosine distance between the fraud training feature vector and the reference vector corresponding to the fraud type is less than a preset screening threshold is used as the target training fraud description information;
[0165] The fraud type identifier of the fraud type is used as the fraud type identifier corresponding to the target training fraud description information.
[0166] Furthermore, the processing module 91 is specifically used for:
[0167] Obtain a reference vector corresponding to each fraud type;
[0168] or,
[0169] A reference vector corresponding to each fraud type is generated according to the training fraud description information corresponding to the at least one training transaction data.
[0170] Furthermore, the processing module 91 is specifically used for:
[0171] Using a large language model to perform keyword extraction processing on each of the training fraud description information to obtain keywords corresponding to each of the training fraud description information;
[0172] For each of the fraud types described, the following is done:
[0173] Determining target description information matching the fraud type from all the training fraud description information according to the keywords corresponding to each of the training fraud description information;
[0174] Using a large language model to extract features from each of the target description information, to obtain a reference feature vector corresponding to each of the target description information;
[0175] The average value of the reference feature vectors corresponding to each target description information is used as the reference vector corresponding to the fraud type.
[0176] Furthermore, the processing module 91 is specifically used for:
[0177] Using a large language model to perform summary extraction processing on each of the training fraud description information to obtain a fraud summary corresponding to each of the training fraud description information;
[0178] A large language model is used to perform keyword extraction processing on the fraud summary corresponding to each of the training fraud description information to obtain the keyword corresponding to each of the training fraud description information.
[0179] The transaction data labeling device provided in this embodiment is used to execute the technical solution of the sample generation device in any of the aforementioned fraud classification model training method embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0180] Fig.10 This is a schematic diagram of the structure of an electronic device provided in this application. Fig.10 As shown, the electronic device 1000 includes:
[0181] Processor 1001, memory 1002, and communication interface 1003;
[0182] The memory 1002 is used to store executable instructions of the processor 1001;
[0183] The processor 1001 is configured to execute the technical solution in any of the aforementioned method embodiments by executing the executable instructions.
[0184] Optionally, the memory 1002 may be independent or integrated with the processor 1001 .
[0185] Optionally, when the memory 1002 is a device independent of the processor 1001, the electronic device 1000 may further include:
[0186] The bus 1004 , the memory 1002 and the communication interface 1003 are connected to the processor 1001 via the bus 1004 and communicate with each other. The communication interface 1003 is used to communicate with other devices.
[0187] Optionally, the communication interface 1003 may be implemented by a transceiver. The communication interface is used to implement communication between the database access device and other devices (such as a client, a read-write library, and a read-only library). The memory may include a random access memory (RAM) and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage.
[0188] The bus 1004 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0189] The above-mentioned processor can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0190] The electronic device is used to execute the technical solution in any of the aforementioned method embodiments, and its implementation principle and technical effect are similar and will not be repeated here.
[0191] An embodiment of the present application also provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the technical solution provided by any of the aforementioned method embodiments is implemented.
[0192] An embodiment of the present application also provides a computer program product, including a computer program, which is used to implement the technical solution provided by any of the aforementioned method embodiments when executed by a processor.
[0193] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0194] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0195] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0196] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for labeling transaction data, characterized in that: include: Obtaining target transaction data and fraud description information corresponding to the target transaction data; Using a large language model to extract features from the fraud description information to obtain a fraud feature vector; Inputting the fraud feature vector into a fraud classification model to obtain a target fraud type identifier; the fraud classification model is a pre-trained federated machine learning model that determines the fraud type identifier based on the feature vector; The target fraud type identifier is used as a label of the target transaction data.
2. A fraud classification model training method, characterized in that: Applied to a training device, the method comprises: Receiving sample data sent by sample generation devices of multiple transaction institutions, each of the sample data includes a training fraud feature vector and a fraud type identifier; The fraud type identifier in each of the sample data is used as a label, and the initial federated machine learning model is trained according to the fraud training feature vector in each of the sample data to obtain a fraud classification model. The fraud classification model is used to determine the fraud type identifier based on the feature vector.
3. A fraud classification model training method, characterized in that: A sample generation device applied to a trading institution, the method comprising: Determine a reference vector corresponding to each fraud type; Determine at least one sample data according to the reference vector corresponding to each fraud type and the training fraud description information corresponding to at least one training transaction data; each of the sample data includes a training fraud feature vector and a fraud type identifier, and each of the sample data is used to perform model training on the initial federated machine learning model to obtain a fraud classification model, and the fraud classification model is used to determine the fraud type identifier according to the feature vector; Each of the sample data is sent to a training device.
4. The method according to claim 3, characterized in that The determining of at least one sample data according to the reference vector corresponding to each fraud type and the training fraud description information corresponding to at least one training transaction data includes: Using a large language model to extract features from each of the training fraud description information, respectively, to obtain a fraud training feature vector corresponding to each of the training fraud description information; Determine target training fraud description information and a fraud type identifier corresponding to each target training fraud description information according to a reference vector corresponding to each fraud type and a fraud training feature vector corresponding to each training fraud description information; For each target training fraud description information, the fraud type identifier and the fraud training feature vector corresponding to the target training fraud description information are used as sample data.
5. The method according to claim 4, characterized in that The step of determining at least one target training fraud description information and a fraud type identifier corresponding to each target training fraud description information according to the reference vector corresponding to each fraud type and the fraud training feature vector corresponding to each training fraud description information includes: For each of the fraud types, the following processing is performed: Among all the training fraud description information, the training fraud description information whose cosine distance between the fraud training feature vector and the reference vector corresponding to the fraud type is less than a preset screening threshold is used as the target training fraud description information; The fraud type identifier of the fraud type is used as the fraud type identifier corresponding to the target training fraud description information.
6. The method according to claim 3, characterized in that The step of determining a reference vector corresponding to each fraud type includes: Obtain a reference vector corresponding to each fraud type; or, A reference vector corresponding to each fraud type is generated according to the training fraud description information corresponding to the at least one training transaction data.
7. The method according to claim 6, characterized in that The step of generating a reference vector corresponding to each fraud type according to the training fraud description information corresponding to the at least one training transaction data includes: Using a large language model to perform keyword extraction processing on each of the training fraud description information to obtain keywords corresponding to each of the training fraud description information; For each of the fraud types described, the following is done: Determining target description information matching the fraud type from all the training fraud description information according to the keywords corresponding to each of the training fraud description information; Using a large language model to extract features from each of the target description information, to obtain a reference feature vector corresponding to each of the target description information; The average value of the reference feature vectors corresponding to each target description information is used as the reference vector corresponding to the fraud type.
8. The method according to claim 7, characterized in that The large language model is used to perform keyword extraction processing on each of the training fraud description information to obtain keywords corresponding to each of the training fraud description information, including: Using a large language model to perform summary extraction processing on each of the training fraud description information to obtain a fraud summary corresponding to each of the training fraud description information; A large language model is used to perform keyword extraction processing on the fraud summary corresponding to each of the training fraud description information to obtain the keyword corresponding to each of the training fraud description information.
9. A transaction data labeling device, characterized in that: include: An acquisition module, used to acquire target transaction data and fraud description information corresponding to the target transaction data; Processing modules for: Using a large language model to extract features from the fraud description information to obtain a fraud feature vector; Inputting the fraud feature vector into a fraud classification model to obtain a target fraud type identifier; the fraud classification model is a pre-trained federated machine learning model that determines the fraud type identifier based on the feature vector; The target fraud type identifier is used as a label of the target transaction data.
10. A fraud classification model training device, characterized in that: include: A receiving module, used to receive sample data sent by sample generation devices of multiple transaction institutions, each of the sample data includes a training fraud feature vector and a fraud type identifier; The model training module is used to use the fraud type identifier in each sample data as a label, and train the initial federated machine learning model according to the fraud training feature vector in each sample data to obtain a fraud classification model, wherein the fraud classification model is used to determine the fraud type identifier according to the feature vector.
11. A fraud classification model training device, characterized in that: include: Processing modules for: Determine a reference vector corresponding to each fraud type; Determine at least one sample data according to the reference vector corresponding to each fraud type and the training fraud description information corresponding to at least one training transaction data; each of the sample data includes a training fraud feature vector and a fraud type identifier, and each of the sample data is used to perform model training on the initial federated machine learning model to obtain a fraud classification model, and the fraud classification model is used to determine the fraud type identifier according to the feature vector; The sending module is used to send each of the sample data to the training device.
12. An electronic device, characterized in that: include: Processor, memory, communication interface; The memory is used to store executable instructions of the processor; Wherein, the processor is configured to execute the transaction data labeling method described in claim 1, or execute the fraud classification model training method described in claim 2 or any one of claims 3 to 8 by executing the executable instructions.
13. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the transaction data labeling method described in claim 1, or implements the fraud classification model training method described in claim 2 or any one of claims 3 to 8.
14. A computer program product, characterized in that It includes a computer program, which, when executed by a processor, is used to implement the transaction data labeling method described in claim 1, or the fraud classification model training method described in claim 2 or any one of claims 3 to 8.
Citation Information
Cited By
Intelligent data labeling method and system for transaction data
CN120579107A