CN117787443A - Wind control method, device, equipment and readable storage medium - Google Patents
Wind control method, device, equipment and readable storage medium Download PDFInfo
- Publication number
- CN117787443A CN117787443A CN202311868400.XA CN202311868400A CN117787443A CN 117787443 A CN117787443 A CN 117787443A CN 202311868400 A CN202311868400 A CN 202311868400A CN 117787443 A CN117787443 A CN 117787443A
- Authority
- CN
- China
- Prior art keywords
- text
- user
- sequence
- wind control
- event
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Machine Translation (AREA)
Abstract
The specification discloses a wind control method, a device, equipment and a readable storage medium, wherein a reference text sequence determined according to a description text for describing the behaviors of each user in a user event is used as a training sample, a pre-trained natural language model is subjected to fine adjustment to obtain a behavior sequence generation model, a target text sequence is obtained according to the behavior sequence generation model and a prompt text, the target text sequence is used as an countermeasure sample, the wind control model is optimized, and wind control is performed through the optimized wind control model. Therefore, through the scheme, the countermeasure sample generated by the behavior sequence generating model is obtained without repeated interaction with the wind control model, the robustness and the precision of the wind control model are improved with low cost and high efficiency, and the obtained behavior sequence generating model is finely adjusted on the basis of the pre-trained natural language model, so that the method and the device are applicable to a plurality of different wind control models taking the user behavior as a training sample, and the optimization efficiency of the wind control model and the safety of privacy data are improved.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a wind control method, device, apparatus, and readable storage medium.
Background
With the improvement of people's attention to privacy data, the fields of artificial intelligence and machine learning are also receiving extensive attention. The rapid development of machine learning has led to the application of various machine learning models in a wide variety of business scenarios. For example, in security and wind control scenarios, wind control models trained by machine learning can be used to identify business objects that present risks or potential safety hazards. For example, a blackout account number, a high risk transaction, or user operation, etc., is identified by a pneumatic control model. After identifying the business objects with risks or potential safety hazards, the wind control model intercepts the business objects so as to ensure the safety of the system and the user.
Although the accuracy of the wind control model is higher and higher, the wind control model is also vulnerable to attacks, for example: against attacks. Challenge attack refers to the process of applying a disturbance to an original sample employed in the training of a wind control model to generate a challenge sample, and spoofing the wind control model by the challenge sample. Therefore, how to improve the capability of the wind control model to resist attack before the wind control model is put into use is a problem to be solved.
Disclosure of Invention
The present specification provides a wind control method, apparatus, device, and readable storage medium, to partially solve the above-mentioned problems in the prior art.
The technical scheme adopted in the specification is as follows:
the specification provides a wind control method, comprising:
acquiring a user event and determining a description text for describing each user behavior in the user event;
determining a reference text sequence according to the description text;
taking the reference text sequence as a training sample, and adjusting model parameters of a pre-trained natural language model to obtain a behavior sequence generation model;
when a prompt text is obtained, inputting the prompt text into the behavior sequence generation model to obtain a target text sequence; the prompt text is used for guiding the behavior sequence generation model to generate a target text sequence for describing the risk event;
taking the target text sequence as a countermeasure sample, and optimizing a pre-trained wind control model;
and performing wind control according to the optimized wind control model.
The present specification provides a wind control device comprising:
the descriptive text determining module is used for acquiring user events and determining descriptive text for describing the behaviors of each user in the user events;
a reference text sequence determining module for determining a reference text sequence according to the description text;
The adjustment module is used for adjusting model parameters of the pre-trained natural language model by taking the reference text sequence as a training sample to obtain a behavior sequence generation model;
the target text sequence determining module is used for inputting the prompt text into the behavior sequence generating model when the prompt text is acquired, so as to obtain a target text sequence; the prompt text is used for guiding the behavior sequence generation model to generate a target text sequence for describing the risk event;
the optimization module is used for optimizing a pre-trained wind control model by taking the target text sequence as a countermeasure sample;
and the wind control module is used for carrying out wind control according to the optimized wind control model.
The present description provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the wind control method described above.
The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the above-described wind control method when executing the program.
The above-mentioned at least one technical scheme that this specification adopted can reach following beneficial effect:
In the wind control method provided by the specification, a pre-trained natural language model is subjected to fine adjustment according to a reference text sequence determined by a description text for describing the behaviors of each user in a user event as a training sample, a behavior sequence generation model is obtained, when a prompt text is obtained, a target text sequence is obtained according to the behavior sequence generation model, the target text sequence is taken as an countermeasure sample, and the wind control model is optimized so as to perform wind control through the optimized wind control model. Therefore, through the scheme, the countermeasure sample generated by the behavior sequence generating model can be obtained without repeated interaction with the wind control model, the robustness and the precision of the wind control model are improved with low cost and high efficiency, and the obtained behavior sequence generating model is finely adjusted on the basis of the pre-trained natural language model, so that the method can be applied to a plurality of different wind control models taking the user behavior as a training sample, and the optimization efficiency of the wind control model is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification, illustrate and explain the exemplary embodiments of the present specification and their description, are not intended to limit the specification unduly. Attached at
In the figure:
FIG. 1 is a schematic flow chart of a wind control method in the present specification;
FIG. 2 is a schematic flow chart of a wind control method in the present specification;
FIG. 3 is a schematic flow chart of a wind control method in the present specification;
FIG. 4 is a schematic view of an air control device provided in the present disclosure;
fig. 5 is a schematic view of the electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present specification more apparent, the technical solutions of the present specification will be clearly and completely described below with reference to specific embodiments of the present specification and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present specification. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
In addition, all the actions for acquiring signals, information or data in the present specification are performed under the condition of conforming to the corresponding data protection rule policy of the place and obtaining the authorization given by the corresponding device owner.
The features of the following examples and embodiments may be combined with each other without any conflict.
Although various existing risk detection models have good effects in aspects of feature processing comprehensiveness, prediction accuracy and the like, the inventor realizes that a risk detection scene is actually a game scene of attack and defense countermeasure: on one hand, the model algorithm tries to comprehensively analyze the business object to identify the risk object, and on the other hand, tries to get around the analysis algorithm of the wind control model or attacks the wind control model to try to break through the identification of the wind control model by the partner of the risk object to get benefited. Therefore, before the wind control model is actually put into use, the wind control model is optimized based on the countermeasure sample so as to improve the robustness of the wind control model, so that the optimized wind control model can better resist potential model attack, and the attack and defense safety is improved. Therefore, the quality of the challenge sample greatly influences the robustness of the optimized wind control model, and the generation of the challenge sample with high quality becomes a problem to be solved urgently.
At present, in a generation scheme of a countermeasure sample suitable for a wind control scene, a countermeasure sample generation model is generally trained, and the countermeasure sample generation model can be subjected to disturbance change aiming at an input original sample to obtain the countermeasure sample, so that the wind control model can misidentify the countermeasure sample. For example, a black sample (an object with risk such as an account number, a transaction, a user behavior, a text, etc.) used when training the wind control model is input into the challenge sample generation model to obtain a challenge sample, and the wind control model may misrecognize the challenge sample as a white sample.
However, the above generation scheme of the challenge sample is to repeatedly perturb the original sample by calculating or estimating the gradient of the error of the wind control model to touch the error boundary of the wind control model, and finally generate the challenge sample. This solution is extremely dependent on multiple interactions with the wind control model, and is labor intensive. Moreover, the countermeasure sample generated based on the scheme is actually defined only in the neighborhood of the original sample of the specific wind control model, and the wind control model applied to different scenes cannot be popularized. Again, in practical applications, the wind control system employed to complete the wind control of the business object may be composed of a large number of different wind control models, and the wind control system cannot repeatedly interact with the challenge sample generation model at low cost.
Based on the above, the present specification provides a wind control method, which is based on a description text for describing behaviors of each user in a user event as a training sample, and performs fine adjustment on a pre-trained natural language model to obtain a behavior sequence generation model, thereby obtaining a target text sequence, and optimizing a wind control model by using the target text sequence as an countermeasure sample, so as to improve the robustness and accuracy of the optimized wind control model.
The following describes in detail the technical solutions provided by the embodiments of the present specification with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a wind control method provided in the present specification.
S100: and acquiring the user event, and determining a description text for describing each user action in the user event.
The embodiment of the specification provides a wind control method, and the execution process of the method can be executed by electronic equipment such as a server for risk identification and control. In addition, in the process of executing the method, the model is generated by the pre-trained natural residual model and the behavior sequence, the electronic device for executing the model training of the model and the electronic device for executing the method can be the same or different, and the description is not limited to the method.
In this specification, a user event refers to a business event that a user takes place when executing a business, such as browsing goods, purchasing goods, booking air tickets, etc. Each user event may include a plurality of user actions, and the user completes the corresponding user event by executing the plurality of user actions when executing the service, for example, the user event of browsing the commodity includes inputting a commodity keyword, viewing commodity details, browsing a product picture, reading a commodity description, viewing a price, and the user event of booking the air ticket includes selecting a starting place and a destination, filling out traveler information, selecting a payment mode, submitting booking the plurality of user actions. According to different business scenes, the number and types of user behaviors contained in the user events can be the same or the same, and the number of the user behaviors respectively contained in different user events is not limited in the specification.
Further, description text describing each user behavior in the user event is determined, wherein the description text is text describing behavior characteristics of each user behavior in a natural language form. When the user executes the service, the behavior characteristics corresponding to each user behavior can be recorded through the service execution log, namely, the user behaviors are in one-to-one correspondence with the corresponding behavior characteristics. When the description text is determined, the description text can be filled with the user behaviors and corresponding behavior features according to a pre-written description template, and the description text for describing each user behavior in the user event can be obtained.
In this specification, the user behaviors may be the same or different, and the user characteristics corresponding to the respective user behaviors may be the same or different, which is not limited in this specification.
Optionally, the user event containing s user actions is recorded as e i ={k 1 :v 1 ,k 2 :v 2 ,…,k i :v i, …k s :v s }. Wherein k is i Is the ith user behavior, v i Is the behavior feature corresponding to the ith user behavior.
For example, user events: and browsing the commodity. Among them, user behavior 1 is included: inputting commodity keywords, and behavior characteristics 1: a mobile phone; user behavior 2: looking at the commodity details, behavior feature 2: a 4G mobile phone; user behavior 3: and checking the price and the behavior characteristics of 3:1000 yuan.
In practical application, in order to adapt to fine tuning of a pre-trained natural language model, the user behaviors and behavior features are generally encoded according to a pre-written description template to obtain a description text. Specific: and determining behavior characteristics corresponding to the behaviors of each user in the user event respectively, and acquiring a description template. The description template is a pre-written text template for generating candidate texts corresponding to user behaviors. In general, in the description template, there may be slots for filling in user behavior, as well as slots for filling in behavior features. Optionally, the descriptive text further includes descriptive hints to facilitate adaptation to fine tuning of the pre-trained natural language model.
Alternatively, the description template may be as follows:
[e i :t i ]wherein ti= [ k ] 1 is v 1 ,k 2 is v 2 ,…,k i is v i, …k s is v s ]。
Further, each user behavior in the user event and behavior characteristics corresponding to each user behavior in the user event are filled in the description template, so that candidate texts of each user behavior are obtained. Specifically, each user behavior and behavior characteristics corresponding to each user behavior are respectively filled into slots corresponding to the user behaviors and slots corresponding to the behavior characteristics in the description template, so that candidate texts corresponding to each user behavior can be obtained.
Alternatively, the description text obtained according to the description template may be:
[ browsing merchandise: the input commodity keywords are mobile phones, the commodity details are 4G mobile phones, and the checking price is 1000 yuan.
And then, sequencing the candidate texts of the user behaviors to obtain descriptive texts for describing the user behaviors in the user event.
In the present specification, there may be no strict logical precedence relationship between a plurality of user behaviors included in one user event, so when generating a description text, the texts corresponding to the user behaviors may be arranged according to the occurrence sequence of different user behaviors, or may be arranged randomly. Specific: and determining a ranking strategy of the candidate texts of the user behaviors, wherein the ranking strategy comprises ranking according to the occurrence sequence of the user behaviors or ranking randomly. And sequencing the candidate texts of each user action according to the sequencing strategy to obtain a description text for describing each user action in the user event.
In addition, in an alternative embodiment of the present disclosure, in order to expand the scale of the training samples used for fine-tuning the pre-trained natural language model, candidate texts of each user behavior included in the same user event may be respectively ranked according to different ranking strategies, so as to obtain multiple description texts corresponding to the same user event.
S102: and determining a reference text sequence according to the descriptive text.
In this specification, the number of the user events acquired in S100 may be plural, and the description text of each user event may be arranged to obtain the reference text sequence. Each user event is noted as [ e1, e2, …, ei, … en ].
In addition, in the specification, because natural time-sequence relations exist among different user events, each user event can be arranged according to the time-sequence of the occurrence time, and corresponding description texts corresponding to each user event can also be arranged according to the time-sequence of the occurrence time of the user event. Therefore, when the reference text sequence is determined according to the description texts, the description texts can be arranged according to the sequence of the occurrence time of the user event to obtain the reference text sequence.
The reference text sequence may be as follows:
[The following is a chronological sequence of user behavior events.e 1 :t 1 ,e 2 :t 2 ,…,e i :t i ,…,e n :t n ]。
s104: and adjusting model parameters of the pre-trained natural language model by taking the reference text sequence as a training sample to obtain a behavior sequence generation model.
Specifically, the pre-trained natural language model is obtained by training according to a general corpus in advance, when the reference text sequence is used as a training sample, the next token in the predicted reference text sequence can be used as a learning target, and the model parameters of the pre-trained natural language model are adjusted by using a Fine-Tuning algorithm such as a supervision Fine-Tuning (SFT) algorithm, a Low-order self-adaptation (LoRA) algorithm of a large language model and the like, so that a behavior sequence generating model is obtained after parameter adjustment.
It is known that the model structure of the behavior sequence generation model is the same as that of the pre-trained natural language model, and the model parameters of the behavior sequence generation model are obtained by adjusting the model parameters of the pre-trained natural language model. The behavior sequence generation model is obtained by fine tuning based on the pre-trained natural language model, so that the training efficiency of the behavior sequence generation model can be effectively improved, and the behavior sequence generation model with higher performance can be obtained without large-scale training samples.
S106: when the prompt text is obtained, the prompt text is input into the behavior sequence generation model, and a target text sequence is obtained. The prompt text is used for guiding the behavior sequence generation model to generate a target text sequence for describing the risk event.
Further, when the prompt text is acquired, the behavior sequence generation model may generate a target text sequence under the guidance of the prompt text. Specifically, the prompt text is used to guide the behavior sequence generation model to generate a target text sequence for describing the risk event. In the step S104, the behavior sequence generation model is obtained by training the reference text sequence as a training sample based on the pre-trained natural language model, and the description text in the reference text sequence is used for describing the behaviors of each user in the user event, so that the behavior sequence generation model also has the capability of outputting the text describing the behaviors of the user. Based on the above, a prompt word for guiding the behavior sequence generation model to output a text for describing the risk event can be added into the prompt text, so that the behavior sequence generation model can output a target text sequence, and the target description text in the target text sequence can be the description text for describing each risk behavior in the risk event.
Alternatively, the prompt text may be obtained from a prompt word and a prompt text template input by a user, and the specific scheme is as follows:
and receiving a prompt word input by a user, wherein the prompt word comprises at least one of an event occurrence sequence, a risk type and an event number. And acquiring a prompt text template, and acquiring a prompt text according to the prompt word and the prompt text template.
In practical applications, the prompt text may be derived from a prompt word entered by the user. The prompt words input by the user can contain different types of prompt information, including at least one of event occurrence sequence, risk type and event number. The time occurrence sequence refers to the sequence of occurrence time of the target event corresponding to each description text in the target text sequence, and may be arranged in the order from first to last or from last to first. The risk type refers to a risk type corresponding to a target event corresponding to each description text in a target text sequence generated by a user required behavior sequence generation model, and the target event in different application scenarios can correspond to different risk types, such as risk types in transaction scenarios including fraud risk, theft risk, money laundering risk and the like, risk types in network security scenarios including hacking attack, viruses, malicious software and the like, or risks caused by problems in links such as suppliers or logistics and the like, such as delay of delivery of the suppliers, interruption of production lines and the like. The number of the events refers to the number of the target events corresponding to each description text in the target text sequence.
In addition, one prompt text may include a plurality of risk types of prompt words, that is, risk types corresponding to target events corresponding to different target description texts may be the same or different in a target text sequence generated by the behavior sequence generation model.
In general, if the prompt word input by the user does not include the event occurrence sequence, the prompt text may be considered to not limit the occurrence sequence of the target event corresponding to each description text in the target text sequence generated by the behavior sequence generation model. Risk type and number of events are the same.
For example, "The following is a chronological sequence of user behavior events" (hereinafter, a text sequence of user behavior events arranged in time series) is a prompt text of the occurrence sequence of the included events. "The following is a chronological sequence of user behavior events with a length of 10and a risk of theft" (the following text sequence of user behavior events arranged in time sequence, the number of user behavior events is 10, and the user behavior events have theft risk) is the prompt text of the three including the occurrence sequence of the events, the risk type and the number of the events.
In addition, before the prompt text is obtained based on the prompt word and the prompt text template, an example text input by a user can be obtained and also introduced into the prompt text, so that the behavior sequence generation model can generate a target text sequence with higher accuracy under the prompt of the example text. The specific scheme is as follows:
first, an example text entered by the user is accepted, the example text including text describing example behaviors of an example event and text describing characteristics of the example behaviors of the example event.
Further, the prompt words and the example text are respectively filled into the prompt text template, and the prompt text is obtained.
In the present specification, the behavior sequence generation model is finely tuned based on a pre-trained natural language model, and thus, the behavior sequence generation model also has a emerging capability, that is, by prompting an example text contained in a text as context information, the behavior sequence generation model can generate a target text sequence more closely to the example text. Specifically, example text is received that is entered by a user, the example text including text describing example behaviors of the example event and text describing characteristics of the example behaviors of the example event. And then, respectively filling the prompt words and the example text into a prompt text template to obtain the prompt text.
For example The following is a chronological sequence of user behavior events.e 1 :t 1 ,e 2 :t 2 ,…”。
S108: and taking the target text sequence as a countermeasure sample, and optimizing a pre-trained wind control model.
And then, the target text sequence can be used as an countermeasure sample, the robustness of the pre-trained wind control model is tested, and when the robustness of the wind control model is poor, the wind control model is optimized by combining the countermeasure sample.
In the present specification, the robustness of the wind control model refers to the performance of the wind control model when facing malicious attacks and deception, and if the model is easily deception by the countermeasure model, the robustness of the wind control model is weaker, that is, when the target text sequence is input into the wind control model, the wind control model cannot accurately identify the risk type of the target event corresponding to the target description text contained in the target text sequence. The method for improving the accuracy and the robustness of the wind control model based on the countermeasure sample mixes the countermeasure sample into the original sample of the wind control model, so that the wind control model can learn the characteristic of the countermeasure attack better, and the accuracy and the robustness of the wind control model are improved.
Optionally, with the target text sequence as a countermeasure sample, optimizing the wind control model may be implemented according to the following scheme:
The first step: and inputting the target text sequence into a pre-trained wind control model to obtain a predicted risk type corresponding to each target event in the target text sequence output by the wind control model.
In the embodiment of the present disclosure, the target text sequence is taken as the challenge sample, and the wind control model is directly optimized by the challenge sample, so that the optimized wind control model can have the capability of resisting the challenge attack of the target text sequence.
Specifically, the target text sequence is input into a pre-trained wind control model, the wind control model can perform risk identification on target events corresponding to each target description text contained in the target text sequence one by one, and the predicted risk types corresponding to each target event are obtained and output.
And a second step of: and acquiring label risk types corresponding to each target event in the target text sequence.
Determining the tag risk type for each target event may be accomplished in two ways:
firstly, when a target text sequence is generated through a behavior sequence generation model in S106, a prompt word of a risk type input by a user is contained in a prompt text input into the behavior sequence generation model, and the prompt word of the risk type input by the user is the label risk type corresponding to each target event in the target text sequence generated by the behavior sequence generation model. The label risk types corresponding to different target events can be the same or different, and the specification does not limit the label risk types.
Secondly, if the prompt text adopted for generating the target text sequence in S106 does not contain the prompt word of the risk type, the label risk type corresponding to each target event can be obtained through modes such as manual labeling, other wind control model recognition and the like.
And a third step of: and optimizing the wind control model by taking the minimization of the difference between the predicted risk type and the label risk type as an optimization target.
Specifically, the purpose of optimizing the wind control model according to the challenge sample is to make the wind control model possess the capability of resisting the challenge attack such as the challenge sample, so the wind control model needs to possess the capability of accurately identifying the challenge sample so as not to be deceptively deceived by the challenge sample in practical application. Therefore, the optimization objective of optimizing the wind control model is to minimize the difference between the predicted risk type and the tag risk type output by the wind control model. The loss function used for optimizing the wind control model can be any type of existing loss function, such as mean square error loss, cross entropy loss, logarithmic loss and the like, and the specification is not limited thereto.
S110: and performing wind control according to the optimized wind control model.
In the step, the optimized wind control model has the capability of resisting resistance attack, so that the wind control model can be put into practical application and used for identifying the risk type of a business event generated when a user executes the business, and different risk strategies and control measures are adopted based on the risk type of the business event.
In the wind control method provided by the description, a pre-trained natural language model is subjected to fine adjustment according to a reference text sequence determined by a description text for describing the behaviors of each user in a user event as a training sample, a behavior sequence generation model is obtained, a target text sequence is obtained according to the behavior sequence generation model and a prompt text, the target text sequence is used as an countermeasure sample, the wind control model is optimized, and wind control is performed through the optimized wind control model.
Therefore, through the scheme, the countermeasure sample generated by the behavior sequence generating model is obtained without repeated interaction with the wind control model, the robustness and the precision of the wind control model are improved with low cost and high efficiency, and the obtained behavior sequence generating model is finely adjusted on the basis of the pre-trained natural language model, so that the method is applicable to a plurality of different wind control models taking the user behavior as a training sample, and the optimization efficiency of the wind control model is improved.
In one or more embodiments of the present disclosure, the generating the reference text sequence in S102 may be implemented specifically by using the following scheme, as shown in fig. 2:
s200: the occurrence time of each user event is obtained.
As described above, a natural time-sequence relationship exists between different user events, and therefore, each user event can be arranged according to the time sequence of the time occurrence moment. For this reason, in this step, the occurrence time of each user event is acquired, and the occurrence time is typically recorded in the service execution log. Based on the occurrence time of each user event, each user event may be ordered from the beginning to the end of the occurrence time, or may be ordered from the end to the beginning of the occurrence time.
S202: and sequencing the description texts for describing the user events according to the occurrence time of the user events to obtain candidate text sequences.
Based on the occurrence time of each user event, the user events can be arranged, and similarly, based on the occurrence time of each user event, the description texts corresponding to the user events can be respectively ordered from first to last or from last to first according to the occurrence time, so that candidate text sequences can be obtained.
S204: and acquiring a first indicator, wherein the first indicator is used for indicating the occurrence sequence of each user event contained in the generated reference text sequence.
The first indicator may be pre-written to indicate that the descriptive text in the sequence of reference text is ordered according to the time of occurrence of the user event. For example, "the following is a descriptive text sequence of individual user events arranged in order of occurrence time from first to last", or "the following is a descriptive text sequence of individual user events arranged in order of occurrence time from last trace".
S206: and splicing the first indicator word and the candidate text sequence to obtain a reference text sequence.
In one or more embodiments of the present disclosure, the generating the reference text sequence in S102 may be implemented specifically by using the following scheme, as shown in fig. 3:
s300: and acquiring the occurrence time of each user event and the risk type of each user event.
In the embodiment of the present disclosure, the information obtained in S300 includes, in addition to the occurrence time of each user event, the risk type of each user event. The risk types of all user events can be obtained through manual labeling or through other risk identification models with higher accuracy. The risk types of the user events may be the same or different, and the present specification is not limited to this.
S302: and sequencing the description texts for describing the user events according to the occurrence time of the user events to obtain candidate text sequences.
Similar to S202, a detailed description is omitted here.
S304: and determining a second indicator according to the risk type of each user event, wherein the second indicator is used for indicating the occurrence sequence of each user event and the risk type of each user event contained in the generated reference text sequence.
The second prompt word is used for indicating that each description text in the reference text sequence is ordered according to the occurrence time of the user event and the risk type corresponding to the user event corresponding to each description text in the reference text sequence. Therefore, the second prompt word is also determined according to the risk type of each user event.
For example, "the following is a descriptive text sequence of each user event arranged in order of occurrence time from first to last, each risk type of each user event is a theft risk", or "the following is a descriptive text sequence of each user event arranged in order of occurrence time from last, each risk type of each user event is a theft risk".
S306: and splicing the second indicator word and the candidate text sequence to obtain a reference text sequence.
The wind control method provided for one or more embodiments of the present disclosure further provides a corresponding wind control device based on the same concept, as shown in fig. 4.
Fig. 4 is a schematic diagram of an air control device provided in the present specification, specifically including:
the descriptive text determining module 400 is configured to obtain user events and determine descriptive text for describing behaviors of users in the user events;
a reference text sequence determination module 402, configured to determine a reference text sequence according to the description text;
the adjustment module 404 is configured to adjust model parameters of the pre-trained natural language model by using the reference text sequence as a training sample, so as to obtain a behavior sequence generation model;
the target text sequence determining module 406 is configured to input the prompt text into the behavior sequence generating model to obtain a target text sequence when the prompt text is obtained; the prompt text is used for guiding the behavior sequence generation model to generate a target text sequence for describing the risk event;
an optimization module 408, configured to optimize a pre-trained wind control model with the target text sequence as an countermeasure sample;
The wind control module 410 is configured to perform wind control according to the optimized wind control model.
Optionally, the description text determining module 400 is specifically configured to determine behavior characteristics corresponding to each user behavior in the user event; acquiring a description template; filling each user behavior in the user event and behavior characteristics corresponding to each user behavior in the user event into the description template to obtain candidate texts of each user behavior; and sequencing the candidate texts of the user behaviors to obtain descriptive texts for describing the user behaviors in the user event.
Optionally, the reference text sequence determining module 402 is specifically configured to obtain an occurrence time of each user event in the user events; according to the occurrence time of each user event, sequencing each description text for describing each user event to obtain a candidate text sequence; acquiring a first indicator, wherein the first indicator is used for indicating the occurrence sequence of each user event contained in the generated reference text sequence; and splicing the first indicator word and the candidate text sequence to obtain a reference text sequence.
Optionally, the reference text sequence determining module 402 is specifically configured to obtain an occurrence time of each user event and a risk type of each user event; according to the occurrence time of each user event, sequencing each description text for describing each user event to obtain a candidate text sequence; determining a second indicator according to the risk types of the user behaviors, wherein the second indicator is used for indicating the occurrence sequence of the user events and the risk types of the user events contained in the generated reference text sequence; and splicing the second indicator word and the candidate text sequence to obtain a reference text sequence.
Optionally, the target text sequence determining module 406 is specifically configured to receive a prompt word input by a user, where the prompt word includes at least one of an event occurrence sequence, a risk type, and an event number; acquiring a prompt text template; and obtaining a prompt text according to the prompt word and the prompt text template.
Optionally, the apparatus further comprises:
an example text receiving module 412, specifically configured to accept an example text input by the user, where the example text includes text describing each example behavior of an example event, and text describing characteristics of each example behavior of the example event;
optionally, the target text sequence determining module 406 is specifically configured to fill the prompt word and the example text into the prompt text template respectively, so as to obtain a prompt text.
Optionally, the optimizing module 408 is specifically configured to input the target text sequence into a pre-trained wind control model, so as to obtain a predicted risk type corresponding to each target event in the target text sequence output by the wind control model; acquiring label risk types corresponding to each target event in the target text sequence; and optimizing the wind control model by taking the minimization of the difference between the predicted risk type and the label risk type as an optimization target.
The present specification also provides a computer readable storage medium storing a computer program operable to perform the wind control method shown in fig. 1 described above.
The present specification also provides a schematic structural diagram of the electronic device shown in fig. 5. At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile storage, as illustrated in fig. 5, although other hardware required by other services may be included. The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to realize the wind control method shown in the figure 1. Of course, other implementations, such as logic devices or combinations of hardware and software, are not excluded from the present description, that is, the execution subject of the following processing flows is not limited to each logic unit, but may be hardware or logic devices.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable Gate Array, FPGA)) is an integrated circuit whose logic function is determined by the programming of the device by a user. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), lava, lola, myHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present specification.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present description is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may 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, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present disclosure and is not intended to limit the disclosure. Various modifications and alterations to this specification will become apparent to those skilled in the art. Any modifications, equivalent substitutions, improvements, or the like, which are within the spirit and principles of the present description, are intended to be included within the scope of the claims of the present description.
Claims (10)
1. A method of wind control, the method comprising:
acquiring a user event and determining a description text for describing each user behavior in the user event;
determining a reference text sequence according to the description text;
taking the reference text sequence as a training sample, and adjusting model parameters of a pre-trained natural language model to obtain a behavior sequence generation model;
when a prompt text is obtained, inputting the prompt text into the behavior sequence generation model to obtain a target text sequence; the prompt text is used for guiding the behavior sequence generation model to generate a target text sequence for describing the risk event;
Taking the target text sequence as a countermeasure sample, and optimizing a pre-trained wind control model;
and performing wind control according to the optimized wind control model.
2. The method according to claim 1, wherein the determining the descriptive text for describing each user behavior in the user event specifically comprises:
determining behavior characteristics corresponding to each user behavior in the user event;
acquiring a description template;
filling each user behavior in the user event and behavior characteristics corresponding to each user behavior in the user event into the description template to obtain candidate texts of each user behavior;
and sequencing the candidate texts of the user behaviors to obtain descriptive texts for describing the user behaviors in the user event.
3. The method according to claim 1, wherein the determining a reference text sequence according to the descriptive text specifically comprises:
acquiring the occurrence time of each user event in the user events;
according to the occurrence time of each user event, sequencing each description text for describing each user event to obtain a candidate text sequence;
acquiring a first indicator, wherein the first indicator is used for indicating the occurrence sequence of each user event contained in the generated reference text sequence;
And splicing the first indicator word and the candidate text sequence to obtain a reference text sequence.
4. The method according to claim 1, wherein the determining a reference text sequence according to the descriptive text specifically comprises:
acquiring the occurrence time of each user event and the risk type of each user event;
according to the occurrence time of each user event, sequencing each description text for describing each user event to obtain a candidate text sequence;
determining a second indicator according to the risk types of the user behaviors, wherein the second indicator is used for indicating the occurrence sequence of the user events and the risk types of the user events contained in the generated reference text sequence;
and splicing the second indicator word and the candidate text sequence to obtain a reference text sequence.
5. The method of claim 1, obtaining a prompt text, comprising:
receiving a prompt word input by a user, wherein the prompt word comprises at least one of an event occurrence sequence, a risk type and an event number;
acquiring a prompt text template;
and obtaining a prompt text according to the prompt word and the prompt text template.
6. The method of claim 5, wherein before obtaining the hint text from the hint word and the hint text template, the method further comprises:
accepting example text entered by the user, the example text including text describing example behaviors of an example event and text describing characteristics of the example behaviors of the example event;
obtaining a prompt text according to the prompt word and the prompt text template, wherein the method specifically comprises the following steps:
and respectively filling the prompt words and the example text into the prompt text template to obtain prompt texts.
7. The method according to claim 1, wherein the optimization of the pre-trained wind control model using the target text sequence as a challenge sample specifically comprises:
inputting the target text sequence into a pre-trained wind control model to obtain a predicted risk type corresponding to each target event in the target text sequence output by the wind control model;
acquiring label risk types corresponding to each target event in the target text sequence;
and optimizing the wind control model by taking the minimization of the difference between the predicted risk type and the label risk type as an optimization target.
8. A wind control device comprising:
the descriptive text determining module is used for acquiring user events and determining descriptive text for describing the behaviors of each user in the user events;
a reference text sequence determining module for determining a reference text sequence according to the description text;
the adjustment module is used for adjusting model parameters of the pre-trained natural language model by taking the reference text sequence as a training sample to obtain a behavior sequence generation model;
the target text sequence determining module is used for inputting the prompt text into the behavior sequence generating model when the prompt text is acquired, so as to obtain a target text sequence; the prompt text is used for guiding the behavior sequence generation model to generate a target text sequence for describing the risk event;
the optimization module is used for optimizing a pre-trained wind control model by taking the target text sequence as a countermeasure sample;
and the wind control module is used for carrying out wind control according to the optimized wind control model.
9. A computer readable storage medium storing a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of the preceding claims 1-7 when the program is executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311868400.XA CN117787443A (en) | 2023-12-29 | 2023-12-29 | Wind control method, device, equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311868400.XA CN117787443A (en) | 2023-12-29 | 2023-12-29 | Wind control method, device, equipment and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117787443A true CN117787443A (en) | 2024-03-29 |
Family
ID=90381600
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311868400.XA Pending CN117787443A (en) | 2023-12-29 | 2023-12-29 | Wind control method, device, equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117787443A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119515398A (en) * | 2025-01-20 | 2025-02-25 | 蚂蚁智信(杭州)信息技术有限公司 | Transaction event risk management and control method and device |
-
2023
- 2023-12-29 CN CN202311868400.XA patent/CN117787443A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119515398A (en) * | 2025-01-20 | 2025-02-25 | 蚂蚁智信(杭州)信息技术有限公司 | Transaction event risk management and control method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107808098B (en) | Model safety detection method and device and electronic equipment | |
CN113516480B (en) | Payment risk identification method, device and equipment | |
CN111881973A (en) | Sample selection method and device, storage medium and electronic equipment | |
CN107679700A (en) | Business flow processing method, apparatus and server | |
CN107644286A (en) | Workflow processing method and device | |
CN111325444B (en) | Risk prevention and control decision method, device, system and equipment | |
CN110674188A (en) | Feature extraction method, device and equipment | |
CN109033772A (en) | A kind of input method and device of verification information | |
CN110633989A (en) | Method and device for determining risk behavior generation model | |
CN109003091A (en) | A kind of risk prevention system processing method, device and equipment | |
CN110032857A (en) | The registration of account, the recognition methods of credible equipment and device | |
CN110738562B (en) | Method, device and equipment for generating risk reminding information | |
CN112966113A (en) | Data risk prevention and control method, device and equipment | |
CN115238250B (en) | Model processing method, device and equipment | |
CN117787443A (en) | Wind control method, device, equipment and readable storage medium | |
CN111507726B (en) | Message generation method, device and equipment | |
CN116822606A (en) | Training method, device, equipment and storage medium of anomaly detection model | |
CN115238826B (en) | Model training method and device, storage medium and electronic equipment | |
CN110033092B (en) | Data label generation method, data label training device, event recognition method and event recognition device | |
CN113221717B (en) | Model construction method, device and equipment based on privacy protection | |
CN110705622A (en) | Decision-making method and system and electronic equipment | |
CN109492401A (en) | A kind of content vector risk checking method, device, equipment and medium | |
CN117454147A (en) | Training method and device for anomaly detection model | |
CN111242195B (en) | Model, insurance wind control model training method and device and electronic equipment | |
CN110008466A (en) | A kind of processing method of data, device and equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |