Email Characterization Model Training Method, Device, Medium, and Equipment
By mapping emails to representation matrices and training a neural network with structural feature vectors, the method addresses the inadequate representation of email features in risk management, enabling efficient and resource-saving email risk assessment.
Patent Information
- Application Number
- CN202310651180.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-02
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2043-06-02
AI Technical Summary
The existing technology cannot effectively characterize the characteristics of mailboxes, resulting in limited application in international risk control business scenarios.
Map the mailbox into a representation matrix, use recurrent neural network to generate structural feature vectors, and train the mailbox representation model through positive samples to realize the characterization of the structural features of the mailbox.
It realizes efficient portrayal of the structural characteristics of the mailbox, supports the application of risk control scenarios of international mailbox risks, saves manpower and time, and has a fast training speed.
Smart Images

Figure CN116701934B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of this specification relate to the technical field of model training, and particularly to a method and device, medium, and equipment for training an email representation model. Background Art
[0002] Through research on external risk control service providers, it is found that email is an important dimension for identifying risks. However, in the international risk control business scenario, the features of many risk control models are constructed based on tabular data, and the features of emails cannot be well represented. Therefore, emails cannot be applied in risk prevention and control. Summary of the Invention
[0003] One or more embodiments of this specification describe a method and device, medium, and equipment for training an email representation model.
[0004] According to a first aspect, an email representation model training method provided by an embodiment of this specification includes:
[0005] Mapping each email in a preset email set to a corresponding representation matrix; wherein, each representation matrix corresponding to an email includes N representation vectors, and the i-th representation vector is used to represent the type to which the i-th character in the email belongs, N is the number of characters in the email, and N is a positive integer greater than 1;
[0006] Inputting the representation matrix corresponding to each email into a to-be-trained recurrent neural network to obtain a structural feature vector corresponding to the email; the structural feature vector corresponding to each email is used to represent the structural features of the email, and the structural features of each email include the types to which the respective characters included in the email belong and the positional sorting relationship between the characters of each type;
[0007] Generating a positive sample pair corresponding to the email according to the structural feature vector corresponding to each email;
[0008] Using the positive sample pairs corresponding to each email to train the recurrent neural network to obtain an email representation model, and the email representation model can output structural feature vectors with higher similarity for different emails with higher similarity of structural features.
[0009] According to a second aspect, an email representation model training device provided by an embodiment of this specification includes:
[0010] A first mapping module, configured to map each email in a preset email set to a corresponding representation matrix; wherein, each representation matrix corresponding to an email includes N representation vectors, and the i-th representation vector is used to represent the type to which the i-th character in the email belongs, N is the number of characters in the email, and N is a positive integer greater than 1;
[0011] A vector acquisition module, configured to input a representation matrix corresponding to each mailbox into a to-be-trained recurrent neural network, and obtain a structural feature vector corresponding to the mailbox; the structural feature vector corresponding to each mailbox is used to represent the structural feature of the mailbox, and the structural feature of each mailbox includes the respective types of each character included in the mailbox and the positional sorting relationship between characters of each type.
[0012] A sample formation module, configured to generate a positive sample pair corresponding to the mailbox according to the structural feature vector corresponding to each mailbox.
[0013] A model training module, configured to use the positive sample pairs corresponding to each mailbox to perform model training on the recurrent neural network, and obtain a mailbox representation model, where the mailbox representation model can output structural feature vectors with higher similarity for different mailboxes with higher similarity of structural features.
[0014] According to a third aspect, a computer-readable storage medium provided in an embodiment of this specification stores a computer program, and when the computer program is executed on a computer, the computer is caused to execute the method provided in the first aspect.
[0015] According to a fourth aspect, a computing device provided in an embodiment of this specification includes a memory and a processor, where the memory stores executable code, and when the processor executes the executable code, the method provided in the first aspect is implemented.
[0016] The mailbox characterization model training method, device, medium, and equipment provided in the embodiments of this specification first map each mailbox in a preset mailbox set to a corresponding characterization matrix, then input the characterization matrix corresponding to each mailbox into a recurrent neural network to be trained to obtain the structural feature vector corresponding to the mailbox, and then generate a positive sample pair corresponding to the mailbox according to the structural feature vector corresponding to each mailbox. Finally, the recurrent neural network is trained based on the positive sample pairs corresponding to each mailbox to obtain a mailbox characterization model. In the embodiments of the present invention, the structural features of the mailbox are characterized by the structural feature vector, which reflects information such as what types of characters are included in a mailbox and the sequential relationship between these types of characters. The structural features are very important for the similarity discrimination of mailboxes. Although the mailbox is text-type data, the semantic information contained in the mailbox is very little. Therefore, compared with the semantic information, the structural features can better reflect the security risk of the mailbox. Therefore, the structural features have greater application significance for the mailbox in the risk control scenario compared with the semantic information. It can be seen that the mailbox characterization model obtained by the mailbox characterization model training method provided in the embodiments of the present invention can realize the characterization of the structural features of the mailbox and can serve well in the relevant risk control scenarios of international mailbox risks. At the same time, the training process does not require manual annotation of samples, which saves both manpower and time and can quickly train the required mailbox characterization model. Brief Description of the Drawings
[0017] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of this specification. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0018] Figure 1 It is a schematic flowchart of the mailbox characterization model training method in an embodiment of this specification;
[0019] Figure 2 It is a structural block diagram of the mailbox characterization model training device in an embodiment of this specification. Detailed Embodiments
[0020] The following describes the solutions provided in this specification with reference to the drawings.
[0021] As mentioned in the background art, there is currently no solution that can well characterize the features of mailboxes. The features of mailboxes, for example, character types, the positional relationship between different types of characters, etc. Therefore, mailboxes cannot be applied in risk prevention and control yet.
[0022] To this end, the embodiments of this specification provide a method for training a mailbox representation model, which includes: mapping each mailbox in a preset mailbox set to a corresponding representation matrix; where each representation matrix corresponding to a mailbox includes N representation vectors, and the i-th representation vector is used to represent the type to which the i-th character in the mailbox belongs, N is the number of characters in the mailbox, and N is a positive integer greater than 1; inputting the representation matrix corresponding to each mailbox into a recurrent neural network to be trained to obtain a structural feature vector corresponding to the mailbox; the structural feature vector corresponding to each mailbox is used to represent the structural features of the mailbox, and the structural features of each mailbox include the types to which the respective characters included in the mailbox belong and the positional sorting relationship between the characters of each type; generating a positive sample pair corresponding to the mailbox according to the structural feature vector corresponding to each mailbox; using the positive sample pairs corresponding to each mailbox to train the recurrent neural network to obtain a mailbox representation model, and the mailbox representation model can output structural feature vectors with higher similarity for different mailboxes with higher similarity of structural features.
[0023] The following describes the specific implementation of the above concept.
[0024] Figure 1 It is a schematic flowchart of a method for training a mailbox representation model in an embodiment of the present invention. It can be understood that this method can be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. Refer to Figure 1 , the method for training a mailbox representation model includes the following steps S102 to S108:
[0025] S102. Map each mailbox in the preset mailbox set to a corresponding representation matrix; where each representation matrix corresponding to a mailbox includes N representation vectors, and the i-th representation vector is used to represent the type to which the i-th character in the mailbox belongs, N is the number of characters in the mailbox, and N is a positive integer greater than 1;
[0026] S104. Input the representation matrix corresponding to each mailbox into a recurrent neural network to be trained to obtain a structural feature vector corresponding to the mailbox; the structural feature vector corresponding to each mailbox is used to represent the structural features of the mailbox, and the structural features of each mailbox include the types to which the respective characters included in the mailbox belong and the positional sorting relationship between the characters of each type;
[0027] S106. Generate a positive sample pair corresponding to the mailbox according to the structural feature vector corresponding to each mailbox;
[0028] S108. Use the positive sample pairs corresponding to each email box to train the recurrent neural network to obtain an email box representation model, which can output structural feature vectors with higher similarity for different email boxes with higher similarity of structural features.
[0029] In Figure 1 In the method shown, the structural features of the email box are characterized by the structural feature vectors, which reflect information such as what types of characters are included in an email box and the sequential relationship of the positions of these types of characters. The structural features are very important for the similarity discrimination of email boxes. Although email boxes are text-type data, the semantic information contained in them is very little. Therefore, compared with semantic information, the structural features can better reflect the security risks of email boxes. Therefore, the structural features have greater application significance for email boxes in the risk control scenario compared with semantic information. It can be seen that the email box representation model obtained by the email box representation model training method provided by the embodiments of the present invention can realize the characterization of the structural features of the email box and can serve well in the relevant risk control scenarios of international email box risks. At the same time, the training process does not require manual annotation of samples, which saves both manpower and time, and can quickly train the required email box representation model.
[0030] The following describes Figure 1 the execution manners of each step.
[0031] S102. Map each email box in the preset email box set to a corresponding representation matrix; where, each representation matrix corresponding to an email box includes N representation vectors, and the i-th representation vector is used to represent the type to which the i-th character in the email box belongs, N is the number of characters in the email box, and N is a positive integer greater than 1;
[0032] Among them, the preset email box set includes multiple email boxes.
[0033] Among them, each email box in the preset email box set is converted into a corresponding representation matrix. An email box includes N characters, and an email box corresponds to a representation matrix, so the representation matrix corresponding to the email box includes N representation vectors, and N is a positive integer greater than 1.
[0034] For example, each row in the representation matrix is a representation vector, the i-th row in the representation matrix is the i-th representation vector, and the i-th representation vector is the representation vector corresponding to the type to which the i-th character in the email box belongs, that is, the i-th representation vector represents the type to which the i-th character in the email box belongs.
[0035] It can be seen that not only the types of each character included in the email box can be reflected in the representation vector, but also the position sorting relationship between each type of character can be reflected.
[0036] In one embodiment, mapping each mailbox in the preset mailbox set to a corresponding representation matrix may specifically include:
[0037] Mapping each mailbox in the preset mailbox set to a corresponding digital sequence; wherein, each digital sequence corresponding to a mailbox includes N digits, and the i-th digit represents the type to which the i-th character in the mailbox belongs;
[0038] Mapping the digital sequence corresponding to each mailbox to a corresponding representation matrix; wherein, the representation matrix includes N representation vectors corresponding to the N digits in the digital sequence.
[0039] That is to say, first, a mailbox is converted into a corresponding digital sequence, and then the digital sequence is converted into a representation matrix. Among them, converting a mailbox into a corresponding digital sequence means replacing each character in the mailbox with the digit corresponding to the type to which the character belongs. Converting the digital sequence into a representation matrix means representing each digit in the digital sequence as a vector, that is, a representation vector, and then forming a representation matrix with the respective representation vectors.
[0040] In one embodiment, the type to which each character belongs may be a vowel letter, a consonant letter, a digit, a special character, or a space.
[0041] It can be seen that here the letters in the type are further classified into vowel letters and consonant letters. This is because when vowel letters and consonant letters appear in a mailbox at the same time, if it is a real mailbox, usually the position of the consonant letters is in the front and the position of the vowel letters is in the back. And if it is a forged mailbox, the positions of the vowel letters and consonant letters are random, and it is very likely that the position of the vowel letters is in the front and the position of the consonant letters is in the back. Therefore, the order of the positions of vowel letters and consonant letters also has a certain role in the application of the mailbox in risk prevention and control. Therefore, here the letters are further distinguished as vowel letters or consonant letters, which helps to improve the role of the structural feature vector of the mailbox in risk prevention and control.
[0042] Among them, special characters, for example, @, #, _,., $, %, &, and the special characters that usually appear most frequently in a mailbox are @ and..
[0043] For example, a mailbox is lice@163.com. The type of vowel letters is represented by the digit 1, the type of consonant letters is represented by the digit 2, the type of digits is represented by the digit 3, the type of special characters is represented by 4, and the type of spaces is represented by 5. The digital sequence of this mailbox is 212143334212. Then each digit in the digital sequence is represented as a representation vector.
[0044] Through the observation of a large amount of data, it is found that there is not much semantic information in the email text itself. However, the sorting position relationship of its letters, numbers, and special symbols, as well as the connection between vowel and consonant letters, are very important for characterizing the structural features of the email. For this consideration, the characters are divided into multiple above-mentioned types, and then an email is converted into a corresponding digital sequence, which is actually a way of fuzzy mapping.
[0045] In one embodiment, mapping the digital sequence corresponding to each email to a corresponding representation matrix may specifically include: using an embedding layer to convert each number in the digital sequence corresponding to each email into a corresponding representation vector.
[0046] Among them, the embedding layer is a layer structure in the neural network, and can also be called the embedding layer. Using embedding to convert a number into a representation vector. This method is simple and easy to implement.
[0047] S104. Input the representation matrix corresponding to each email into the recurrent neural network to be trained to obtain the structural feature vector corresponding to this email; wherein, the structural feature vector corresponding to each email is used to characterize the structural features of this email, and the structural features of each email include the respective types to which the characters included in this email belong and the position sorting relationship between the characters of each type;
[0048] Among them, the recurrent neural network is a type of neural network, which is particularly suitable for processing and predicting sequence data. An important feature of the recurrent neural network is that it will use the information before the sequence data when processing the sequence data. This is different from other types of neural networks. Other types of neural networks usually only use the current input information, that is, other types of neural networks may only make predictions based on the current information, while the recurrent neural network can use the context to better predict the next information when processing text.
[0049] It can be understood that the recurrent neural network is a sequence model. A sequence model is a model used to process sequence data. They are usually used to process natural language text, speech data, or other types of time series data. Sequence models are usually deep learning models. They learn features by training on sequence data and can then be used to make predictions or other decisions.
[0050] In one embodiment, the recurrent neural network can be a long short-term memory artificial neural network. The English of the long short-term memory artificial neural network is Long short-term memory artificial neural network, abbreviated as LSTM artificial neural network.
[0051] As a type of recurrent neural network, the LSTM artificial neural network can learn long-term dependencies in sequential data. The LSTM artificial neural network can better capture long-term patterns in sequential data by using some special "memory cells" to store long-term dependency information.
[0052] Among them, in S104, the recurrent neural network is still in an untrained state, so the parameters in the recurrent neural network are initial parameters.
[0053] That is to say, by inputting the representation matrix corresponding to each mailbox into the recurrent neural network, the recurrent neural network will output the structural feature vector corresponding to the mailbox. One mailbox corresponds to one structural feature vector, and the structural feature vector of a mailbox can reflect the structural features of the mailbox. The structural features include information such as what types of characters are included in the mailbox and the positional sorting relationship between these types of characters.
[0054] It can be seen that the preliminary characterization of the structural features of the mailbox can be achieved through the recurrent neural network.
[0055] It can be understood that based on S104, the preliminary characterization of each mailbox is realized, and the structural feature vector of each mailbox is obtained, which can reflect information such as what types of characters are included in the mailbox and the positional sorting relationship between these types of characters.
[0056] Among them, the representation matrix is formed by multiple representation vectors, so the representation matrix is actually time-series data.
[0057] S106. Generate a positive sample pair corresponding to the mailbox according to the structural feature vector corresponding to each mailbox;
[0058] That is to say, based on the structural feature vector of each mailbox, two positive samples of the mailbox are determined, and these two positive samples form the positive sample pair of the mailbox. In this way, for multiple mailboxes, multiple sample pairs can be obtained.
[0059] In one embodiment, S106 may include: performing two regularization processes on the structural feature vector corresponding to each mailbox respectively to obtain the positive sample pair corresponding to the mailbox.
[0060] That is, performing one regularization on the structural feature vector of a mailbox to obtain a positive sample; then performing another regularization on the structural feature vector of the mailbox to obtain another positive sample; the two positive samples are highly similar as a whole, and there are only differences in individual positions. It can be seen that the regularization process changes the structural feature vector very little and does not affect the overall representation of the mailbox.
[0061] It can be seen that by regularizing the structural feature vector of an email twice, differential processing of the structural feature vector of the email is achieved, and two positive samples that are very similar as a whole but only differ in individual positions are obtained, forming a pair of positive samples.
[0062] Further, separately performing two regularization processes on the structural feature vector corresponding to each email to obtain a pair of positive samples corresponding to the email may specifically include:
[0063] Using a dropout layer to separately perform two regularization processes on the structural feature vector corresponding to each email to obtain two samples, and the two samples form a pair of positive samples corresponding to the email;
[0064] Wherein, the dropout layer is used to randomly select a preset number of elements from the structural feature vector corresponding to each email, and replace the selected elements with 0 in the structural feature vector corresponding to the email.
[0065] Wherein, the dropout layer is the Dropout layer in a neural network. As a regularization processing layer in a neural network, the principle of the Dropout layer is to prevent the neurons in the model from being overly correlated in order to overfit the training data by randomly "discarding" (i.e., not considering) some neurons in the model. The advantage of doing this is that it can make the generalization ability of the model stronger.
[0066] In the embodiment of the present invention, the Dropout layer is used to randomly select M elements from the structural feature vector corresponding to the email, and then replace the values of these M elements in the structural feature vector with 0, thereby achieving non-consideration of some elements. M is a preset number. The positions of these M elements in the structural feature vector are not fixed and are randomly selected. Therefore, by performing two processes on the structural feature vector through the dropout layer, two different structural feature vectors, that is, two positive samples, can be obtained.
[0067] Wherein, M is much smaller than the number of elements in the structural feature vector. For example, the number of elements in the structural feature vector is 100 and M is 5.
[0068] It can be seen that based on the above steps, a pair of positive samples can be obtained for one email, and multiple pairs of positive samples can be obtained for multiple emails in a preset email library.
[0069] Here, the method of constructing a pair of positive samples through the Dropout layer does not rely on business experience to construct positive samples and is more universal.
[0070] S108. Using the pairs of positive samples corresponding to each email to train the recurrent neural network to obtain an email representation model, and the email representation model can output structural feature vectors with higher similarity for different emails with higher similarity of structural features.
[0071] That is, based on the multiple positive sample pairs obtained in S106, the recurrent neural network is trained, and the obtained recurrent neural network after training is the mailbox representation model. If the structural features of two mailboxes are more similar, the similarity of the two structural feature vectors output by the mailbox representation model is higher; if the structural features of two mailboxes are more different, the similarity of the two structural feature vectors output by the mailbox representation model is lower.
[0072] In the training scenario, the training of the recurrent neural network can be achieved by using the method of contrastive learning. Contrastive learning is a machine learning method that can enable the model to improve the learning efficiency by comparing the similarities and differences between different objects during the learning process. This method usually compares two different objects and then decides how to learn according to their similarity or difference.
[0073] Among them, the mailbox representation model can be an LSTM model, and the LSTM model can well capture the position differences of different types of characters, so as to well express the structural features of the mailbox.
[0074] In the application scenario, when applying the trained mailbox representation model, the mailbox to be represented also needs to be converted into a corresponding representation matrix, and then the representation matrix is input into the mailbox representation model to obtain the structural feature vector of this mailbox. This structural feature vector can reflect information such as which types of characters are included in the mailbox and the position sorting relationship between characters of each type.
[0075] It can be understood that the mailbox representation model obtained by the mailbox representation model training method provided by the embodiments of the present invention can achieve the characterization of the structural features of the mailbox in the international scenario and can well serve the relevant risk control scenarios of international mailbox risks. At the same time, the training process does not require manual annotation of samples, which saves both manpower and time, and can quickly train the required mailbox representation model.
[0076] Among them, although the mailbox is text-type data, the semantic information contained in the mailbox is very little. Therefore, if the existing semantic-based language model is used, very little semantic information can be extracted, but the extracted semantic information actually has little application significance for the mailbox in the risk control scenario, because the semantic information cannot reflect the security risk of the mailbox. In the embodiments of the present invention, the structural features of a mailbox are characterized by the structural feature vector, reflecting information such as which types of characters are included in a mailbox and the position sequence relationship between these types of characters, and the structural features are very important for the similarity discrimination of mailboxes. Compared with semantic information, structural features can better reflect the security risk of the mailbox. Therefore, structural features have greater application significance for the mailbox in the risk control scenario.
[0077] Moreover, in the embodiments of the present invention, by training a recurrent neural network, a mailbox representation model is obtained. Compared with pre-trained language models such as transformers, the network structure is simpler, the training speed is faster, and the consumed resources are less.
[0078] The specific embodiments of this specification have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0079] In a second aspect, an embodiment of this specification provides a mailbox representation model training device. Refer to Figure 2 , the device 200 includes:
[0080] A first mapping module 202, configured to map each mailbox in a preset mailbox set to a corresponding representation matrix; wherein, each representation matrix corresponding to a mailbox includes N representation vectors, and the i-th representation vector is used to represent the type to which the i-th character in the mailbox belongs, N is the number of characters in the mailbox, and N is a positive integer greater than 1;
[0081] A vector obtaining module 204, configured to input the representation matrix corresponding to each mailbox into a recurrent neural network to be trained, and obtain a structural feature vector corresponding to the mailbox; the structural feature vector corresponding to each mailbox is used to represent the structural feature of the mailbox, and the structural feature of each mailbox includes the types to which the respective characters included in the mailbox belong and the positional sorting relationship between the characters of each type;
[0082] A sample forming module 206, configured to generate a positive sample pair corresponding to the mailbox according to the structural feature vector corresponding to each mailbox;
[0083] A model training module 208, configured to use the positive sample pairs corresponding to each mailbox to perform model training on the recurrent neural network, and obtain a mailbox representation model, where the mailbox representation model can output structural feature vectors with higher similarity for different mailboxes with higher similarity of structural features.
[0084] In one embodiment, the first mapping module includes:
[0085] The first mapping unit is configured to map each mailbox in the preset mailbox set to a corresponding digital sequence; wherein, each digital sequence corresponding to a mailbox includes N digits, and the i-th digit represents the type to which the i-th character in the mailbox belongs.
[0086] The second mapping unit is configured to map the digital sequence corresponding to each mailbox to a corresponding representation matrix, and the representation matrix includes N representation vectors corresponding to the N digits in the digital sequence.
[0087] In one embodiment, the type to which each character belongs is a vowel, a consonant, a digit, a special character, or a space.
[0088] In one embodiment, the first mapping unit is specifically configured to: use an embedding layer to convert each digit in the digital sequence corresponding to each mailbox into a corresponding representation vector.
[0089] In one embodiment, the sample forming module is specifically configured to: perform two regularization processes on the structural feature vector corresponding to each mailbox respectively to obtain a positive sample pair corresponding to the mailbox.
[0090] In one embodiment, the sample forming module is further specifically configured to: use a dropout layer to perform two regularization processes on the structural feature vector corresponding to each mailbox respectively to obtain two samples, and the two samples form a positive sample pair corresponding to the mailbox; wherein, the dropout layer is used to randomly select a preset number of elements from the structural feature vector corresponding to each mailbox, and replace the selected elements with 0 in the structural feature vector corresponding to the mailbox.
[0091] In one embodiment, the recurrent neural network is a long short-term memory artificial neural network.
[0092] It can be understood that for the explanations, specific implementation manners, beneficial effects, examples, etc. of the relevant content in the device provided in the embodiments of the present invention, reference can be made to the corresponding parts in the method provided in the first aspect, and details are not described herein again.
[0093] In a third aspect, an embodiment of this specification provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed on a computer, the computer is made to execute the method in any one of the embodiments in the specification.
[0094] Specifically, a system or device equipped with a storage medium can be provided, on which software program codes for implementing the functions in any one of the above embodiments are stored, and the computer (or CPU or MPU) of the system or device is made to read and execute the program codes stored in the storage medium.
[0095] In this case, the program code read from the storage medium itself can implement the functions of any one of the above embodiments, so the program code and the storage medium storing the program code constitute a part of the present invention.
[0096] In addition, it should be clear that not only can the functions of any one of the above embodiments be realized by executing the program code read by the computer, but also by an operating system or the like operating on the computer based on the instructions of the program code to complete part or all of the actual operations.
[0097] In addition, it can be understood that the program code read from the storage medium is written into the memory provided in the expansion board inserted into the computer or into the memory provided in the expansion module connected to the computer, and then based on the instructions of the program code, a CPU or the like installed on the expansion board or the expansion module is made to execute part or all of the actual operations, so as to realize the functions of any one of the above embodiments.
[0098] It can be understood that the explanations, specific implementation manners, beneficial effects, examples, etc. of the content related to the computer-readable medium provided in the embodiments of the present invention can be referred to the corresponding parts in the method provided in the first aspect, and will not be elaborated here.
[0099] In a fourth aspect, an embodiment of this specification provides a computing device, including a memory and a processor, where an executable code is stored in the memory, and when the processor executes the executable code, it implements the method in any one of the embodiments described in the specification.
[0100] It can be understood that the explanations, specific implementation manners, beneficial effects, examples, etc. of the content related to the computing device provided in the embodiments of the present invention can be referred to the corresponding parts in the method provided in the first aspect, and will not be elaborated here.
[0101] It can be understood that the structure schematically shown in the embodiments of this specification does not constitute a specific limitation on the devices in the embodiments of this specification. In other embodiments of the specification, the above devices may include more or fewer components than shown in the figures, or combine some components, or split some components, or have different component arrangements. The components shown in the figures can be implemented by hardware, software, or a combination of software and hardware.
[0102] For the information interaction, execution process, etc. among the modules in the above devices and systems, since they are based on the same concept as the method embodiments of this specification, the specific content can be referred to the descriptions in the method embodiments of this specification, and will not be elaborated here.
[0103] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the apparatus embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the relevant parts of the method embodiments for the relevant content.
[0104] Those skilled in the art should be able to realize that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, add-ons, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0105] The specific embodiments described above further elaborate on the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only the specific embodiments of the present invention and is not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for training a mailbox representation model, comprising: Mapping each mailbox in a preset mailbox set to a corresponding representation matrix; wherein, each representation matrix corresponding to a mailbox includes N representation vectors, and the i-th representation vector is used to represent the type to which the i-th character in the mailbox belongs, N is the number of characters in the mailbox, and N is a positive integer greater than 1; Inputting the representation matrix corresponding to each mailbox into a recurrent neural network to be trained to obtain a structural feature vector corresponding to the mailbox; the structural feature vector corresponding to each mailbox is used to represent the structural feature of the mailbox, and the structural feature of each mailbox includes the types to which the respective characters included in the mailbox belong and the positional sorting relationship between the characters of each type; Generating a positive sample pair corresponding to each mailbox according to the structural feature vector corresponding to each mailbox; Using the positive sample pairs corresponding to each mailbox to train the recurrent neural network to obtain a mailbox representation model, and the mailbox representation model can output structural feature vectors with higher similarity for different mailboxes with higher similarity of structural features.
2. The method according to claim 1, wherein, The mapping of each mailbox in the preset mailbox set to a corresponding representation matrix includes: Mapping each mailbox in the preset mailbox set to a corresponding digital sequence; wherein, each digital sequence corresponding to a mailbox includes N digits, and the i-th digit represents the type to which the i-th character in the mailbox belongs; Mapping the digital sequence corresponding to each mailbox to a corresponding representation matrix, and the representation matrix includes N representation vectors corresponding to the N digits in the digital sequence.
3. The method according to claim 2, wherein The type to which each character belongs is a vowel letter, a consonant letter, a digit, a special character, or a space.
4. The method according to claim 2, wherein The mapping of the digital sequence corresponding to each mailbox to a corresponding representation matrix includes: using an embedding layer to convert each digit in the digital sequence corresponding to each mailbox into a corresponding representation vector.
5. The method according to claim 1, wherein The generating of a positive sample pair corresponding to each mailbox according to the structural feature vector corresponding to each mailbox includes: performing two regularization processes on the structural feature vector corresponding to each mailbox respectively to obtain a positive sample pair corresponding to the mailbox.
6. The method according to claim 5, wherein, The performing of two regularization processes on the structural feature vector corresponding to each mailbox respectively to obtain a positive sample pair corresponding to the mailbox includes: Using a dropout layer to perform two regularization processes on the structural feature vector corresponding to each mailbox respectively to obtain two samples, and the two samples form the positive sample pair corresponding to the mailbox; wherein, the dropout layer is used to randomly select a preset number of elements from the structural feature vector corresponding to each mailbox and replace the selected elements with 0 in the structural feature vector corresponding to the mailbox.
7. The method according to claim 1, wherein The recurrent neural network is a long short-term memory artificial neural network.
8. A device for training a mailbox representation model, comprising: A first mapping module, configured to map each mailbox in a preset mailbox set to a corresponding representation matrix; wherein, each representation matrix corresponding to a mailbox includes N representation vectors, and the i-th representation vector is used to represent the type to which the i-th character in the mailbox belongs, N is the number of characters in the mailbox, and N is a positive integer greater than 1; A vector acquisition module, configured to input a representation matrix corresponding to each mailbox into a recurrent neural network to be trained, so as to obtain a structural feature vector corresponding to the mailbox; the structural feature vector corresponding to each mailbox is used to represent the structural features of the mailbox, and the structural features of each mailbox include the respective types of each character included in the mailbox and the positional sorting relationship between characters of each type. A sample formation module, configured to generate a positive sample pair corresponding to each mailbox according to the structural feature vector corresponding to each mailbox. A model training module, configured to use the positive sample pairs corresponding to each mailbox to perform model training on the recurrent neural network, so as to obtain a mailbox representation model, and the mailbox representation model can output structural feature vectors with higher similarity for different mailboxes with higher similarity of structural features.
9. A computer-readable storage medium, on which a computer program is stored. When the computer program is executed on a computer, the computer is made to execute the method according to any one of claims 1 to 7.
10. A computing device, including a memory and a processor. An executable code is stored in the memory, and when the processor executes the executable code, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Out-of-order text recognition method, device and equipment
CN111046658A
Medical entity code matching method and system, computer equipment and storage medium
CN115936014A