National name information extraction method and device, computer equipment and storage medium

By generating vocabulary vectors and extracting contextual features, combined with convolutional neural networks and bidirectional long-short-term memory networks, the problem of low efficiency in identifying country name information in traditional methods is solved, realizing intelligent recognition of country name information and improving recognition accuracy. Safety and efficiency, suitable for cross-border remittance collection.

CN118628221APending Publication Date: 2024-09-10INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410478045.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-19
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

When obtaining country name information, the traditional method cannot provide timely feedback when the country name information does not exist in the message. It is easy to extract by mistake, is inefficient, and cannot meet the growing demand for international remittances.

Method used

By generating vocabulary vectors in the messages to be recognized, contextual features are extracted, and matched with preset tag sequences, and technologies such as convolutional neural networks and bidirectional long-short-term memory networks are used to determine country name information and achieve intelligent recognition.

Benefits of technology

It improves the accuracy and efficiency of entity identification of country name information, reduces calculation steps, and enables accurate identification of country name information in cross-border remittances, avoiding unnecessary losses and improving customer satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628221A
    Figure CN118628221A
Patent Text Reader

Abstract

The invention relates to a nationality name information extraction method and device, computer equipment and a storage medium, and is applied to the technical field of artificial intelligence, and the method comprises the steps: generating a word vector corresponding to each vocabulary in a to-be-recognized message; according to the word vector corresponding to each vocabulary, extracting a context feature of each vocabulary; according to the context feature of each vocabulary, matching each vocabulary with a preset tag sequence to obtain a labeling sequence containing each vocabulary and a tag corresponding to each vocabulary; and determining the nationality name information in the message to be identified according to the labeling sequence. According to the method, the semantics of each vocabulary and the context information of the vocabulary in the sentence are fully considered, so that the meaning and effect of each vocabulary in the sentence can be comprehensively understood, the understanding and recognition capability on the vocabulary is improved, the label of each vocabulary can be accurately determined in the matching process, and the matching efficiency is improved. Therefore, the accuracy and the effect of identifying the nationality name information entity are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for extracting country name information. Background Art

[0002] With the deepening development of economic globalization, the scale and scope of international trade are also expanding. Understanding and complying with the relevant financial regulatory regulations of various countries in international trade is an inevitable requirement for banks in cross-border remittances. This not only allows banks to avoid unnecessary losses, but also allows banks to abide by the rules to ensure that customers' international remittances are safe and efficient. Therefore, in the process of massive remittances, it is crucial to accurately and timely identify the country name information of the paying bank and the receiving bank in order to master the financial regulatory rules of the corresponding country.

[0003] The traditional way to obtain country name information is to manually read or obtain the message through a simple program, such as the country name information in the MT message (message type, fin). After finding the country name information, check the relevant regulatory provisions of the corresponding country in the system. However, some messages contain address information but not necessarily country name information. At the same time, the remitter and the beneficiary also contain country names. The traditional extraction method cannot provide timely feedback when there is no country name information in the message, and it is easy to extract the country name information by mistake. As a result, the method of simply identifying the entity information in the message item cannot meet the identification needs. Summary of the invention

[0004] Based on this, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium and computer program product for extracting country name information in order to address the technical problem that the above-mentioned method of simply identifying entity information in message items cannot meet the identification needs.

[0005] In a first aspect, the present application provides a method for extracting country name information. The method comprises:

[0006] Generate a word vector corresponding to each word in the message to be recognized;

[0007] Extracting context features of each of the words according to the word vector corresponding to each of the words;

[0008] According to the context features of each of the words, each of the words is matched with a preset label sequence to obtain a label sequence including each of the words and the label corresponding to each of the words;

[0009] According to the marking sequence, the country name information in the message to be identified is determined.

[0010] In one embodiment, generating a word vector corresponding to each word in the message to be recognized includes:

[0011] Performing word segmentation processing on the message to be identified to obtain a plurality of words contained in the message to be identified;

[0012] The word vector corresponding to each word is obtained through the pre-trained word embedding model, and the word vector corresponding to each word in the message to be identified is obtained.

[0013] In one embodiment, extracting the context features of the message to be identified according to the word vector corresponding to each of the words includes:

[0014] Inputting the word vector corresponding to each of the words into a convolutional neural network, and extracting local features around each of the words through the convolutional neural network;

[0015] The local features around each of the words are input into a bidirectional long short-term memory network, and the context features of each of the words are extracted through the bidirectional long short-term memory network.

[0016] In one embodiment, determining the country name information in the message to be identified according to the marking sequence includes:

[0017] Determining first country name information from the tag sequence;

[0018] Remove the country name entity tag and the vocabulary corresponding to the country name entity tag from the marked sequence to obtain a processed sequence, and determine the second country name information according to the processed sequence;

[0019] The country name information in the message to be identified is determined according to the first country name information and the second country name information.

[0020] In one embodiment, determining the country name information in the message to be identified according to the first country name information and the second country name information includes:

[0021] When the first country name information and the second country name information are the same, determining the first country name information or the second country name information as the country name information in the message to be identified;

[0022] When the first country name information and the second country name information are different, the first country name information, the second country name information, and prompt information are output; the prompt information is used to prompt further identification operations.

[0023] In one embodiment, determining the second country name information according to the processed sequence includes:

[0024] The processed sequence is input into a trained country recognition network to obtain second country name information corresponding to the processed sequence.

[0025] In one embodiment, each of the words is matched with a preset tag sequence according to the context features of each of the words to obtain a tag sequence including each of the words and the tag corresponding to each of the words, including:

[0026] The context feature of each word and the preset tag sequence are input into a conditional random field, each word is matched with the preset tag sequence through the conditional random field, and the tag sequence is output.

[0027] In a second aspect, the present application also provides a device for extracting country name information. The device comprises:

[0028] A word vector generation module is used to generate a word vector corresponding to each word in the message to be recognized;

[0029] A feature extraction module, used to extract context features of each of the words according to the word vector corresponding to each of the words;

[0030] A vocabulary label matching module, used to match each of the words with a preset label sequence according to the contextual features of each of the words, to obtain a label sequence including each of the words and the label corresponding to each of the words;

[0031] The entity identification module is used to determine the country name information in the message to be identified based on the marking sequence.

[0032] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0033] Generate a word vector corresponding to each word in the message to be recognized;

[0034] Extracting context features of each of the words according to the word vector corresponding to each of the words;

[0035] According to the context features of each of the words, each of the words is matched with a preset label sequence to obtain a label sequence including each of the words and the label corresponding to each of the words;

[0036] According to the marking sequence, the country name information in the message to be identified is determined.

[0037] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0038] Generate a word vector corresponding to each word in the message to be recognized;

[0039] Extracting context features of each of the words according to the word vector corresponding to each of the words;

[0040] According to the context features of each of the words, each of the words is matched with a preset label sequence to obtain a label sequence including each of the words and the label corresponding to each of the words;

[0041] According to the marking sequence, the country name information in the message to be identified is determined.

[0042] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0043] Generate a word vector corresponding to each word in the message to be recognized;

[0044] Extracting context features of each of the words according to the word vector corresponding to each of the words;

[0045] According to the context features of each of the words, each of the words is matched with a preset label sequence to obtain a label sequence including each of the words and the label corresponding to each of the words;

[0046] According to the marking sequence, the country name information in the message to be identified is determined.

[0047] The above-mentioned country name information extraction method, device, computer equipment, storage medium and computer program product generate a word vector corresponding to each word in the message to be identified for the message to be identified; then extract the context features of each word according to the word vector corresponding to each word; further match each word with a preset label sequence according to the context features of each word to obtain a label sequence containing each word and the label corresponding to each word; finally, determine the country name information in the message to be identified according to the label sequence. In this method, by converting the words in the message to be identified into word vectors, extracting the context features, and then matching the label sequence to determine the country name information, the semantics of each word and the context information of the word in the sentence are fully considered, so that the meaning and role of each word in the sentence can be more fully understood, and the ability to understand and identify words can be improved, thereby helping the matching process to accurately determine the label of each word, thereby improving the accuracy and effect of the entity recognition of the country name information. Moreover, this method can realize the intelligent recognition of country name entities through word vector representation, context feature extraction, label sequence matching and annotation sequence determination of the country name information process, reduce unnecessary calculation and processing steps, improve recognition efficiency, speed up the recognition speed of country name information entities, and thus improve the overall recognition efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A schematic diagram of a flow chart of a method for extracting Chinese alias name information according to an embodiment;

[0049] Figure 2 (a) is a schematic diagram of the structure of a continuous bag-of-words model in one embodiment;

[0050] Figure 2 (b) is a schematic diagram of the structure of a word skipping model in one embodiment;

[0051] Figure 3 Schematic diagram of the structure of a convolutional neural network in one embodiment;

[0052] Figure 4 A schematic diagram of the structure of a long short-term memory neural network in one embodiment;

[0053] Figure 5 A schematic diagram of the structure of a bidirectional long short-term memory neural network in one embodiment;

[0054] Figure 6 A flowchart of a step of determining alias name information in an embodiment;

[0055] Figure 7 It is a schematic diagram of the overall structure of a country name entity recognition model for extracting country name information in an MT103 message in one embodiment;

[0056] Figure 8 It is a structural block diagram of a Chinese alias name information extraction device according to an embodiment;

[0057] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0059] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.

[0060] It is understandable that the traditional method of obtaining the country name information in the MT message through manual reading or simple programs cannot provide timely feedback when there is no country name information in the MT message, except when there is address information in the MT message but not necessarily country name information, or when the remitter or beneficiary also contains the country name, and is prone to erroneous extraction of country name information. In addition, with the increasing volume of international remittance transactions and more and more countries joining in international trade, the traditional method of obtaining the country name information in the MT message through manual or simple programs is inefficient and cannot meet the growing demand for international remittances.

[0061] Therefore, the present application provides a method for extracting the Chinese alias name information of the MT message. The method uses an artificial intelligence method to extract the correct country name information of the remitter from the 50K item of the MT message, which is of great significance for avoiding unnecessary losses caused by violations of regulatory regulations, improving the efficiency of cross-border remittances, improving customer satisfaction, and building a fully automatic remittance system.

[0062] refer to Figure 1, is a flow chart of a method for extracting country name information according to an embodiment. This embodiment uses the method applied to a server as an example for illustration. It is understandable that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be but is not limited to various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster consisting of multiple servers. In this embodiment, the method includes the following steps:

[0063] Step S110, generating a word vector corresponding to each word in the message to be recognized.

[0064] The message to be identified may be an MT103 message or any other MT message except the MT103 message. The MT103 message is called a single credit remittance, which is a type of SWIFT message and is mainly used for payment details during international bank transfers. The specific contents include the paying bank, the receiving bank, etc. SWIFT is an international funds clearing system. Using SWIFT can provide secure and efficient communication services for bank settlements and improve the settlement speed of banks.

[0065] In a specific implementation, after obtaining the message to be identified, a word vector corresponding to each word in the message to be identified can be generated through a pre-trained word embedding model. The word embedding model can map each word to a vector representation in a high-dimensional real number vector space.

[0066] For example, the word embedding model may be a Word2Vec pre-trained model, through which semantic information of 50K items of the MT103 message is extracted, and the word vector corresponding to each word in the MT103 message is generated in conjunction with the context information.

[0067] Step S120, extracting the context feature of each word according to the word vector corresponding to each word.

[0068] The contextual features of a word represent the contextual information around the word. The contextual features of a word can be determined based on at least one of the word vectors, semantic information, part-of-speech tag information, word frequency information of other surrounding words, and the grammatical relationship between the surrounding words. The word frequency information of the surrounding words can reflect the importance of the word in the context. Words that often appear around the word may have a greater impact on the semantics of the word.

[0069] In the specific implementation, for each word, the word vector in its context can be used to represent its context features. The word vector of the words in the entire sentence can also be used to represent the context features of the sentence, so as to capture the context information more comprehensively. The context features of each word can also be extracted with the help of a neural network model.

[0070] When extracting the context features of each word with the help of a neural network model, the context features of each word can be extracted by a convolutional neural network and a bidirectional long short-term memory network. The convolutional neural network is used to obtain the local features around each word, and the bidirectional long short-term memory network is used to extract the context features of each word.

[0071] Step S130 , matching each word with a preset tag sequence according to the contextual features of each word, to obtain a label sequence including each word and a tag corresponding to each word.

[0072] The tag sequence is determined based on the message type of the message to be identified, and the tag sequence may include multiple tags, which may represent the entity type. For example, if the message to be identified is an MT103 message, the tags in the tag sequence may include: account number, name, address (including country name, province, city, county, street, etc.).

[0073] In the specific implementation, after obtaining the context features of each word in the message to be identified, it can be decoded through the conditional random field (CRF) to obtain the best label sequence. Specifically, the context features of each word in the message to be identified and the preset label sequence can be used as input information, input into the conditional random field, and each word is matched with the preset label sequence through the conditional random field, and the optimal label sequence is output as the label sequence of the message to be identified.

[0074] Step S140: determining the country name information in the message to be identified according to the marking sequence.

[0075] In a specific implementation, the annotation sequence includes each word in the message to be identified and a label corresponding to each word, and the label is of the type of account, name, address (including country name, province, city, county, street, etc.). Therefore, in one implementation, a country name entity label can be selected based on the label corresponding to each word, and the country name information in the message to be identified can be determined from the word corresponding to the country name entity label.

[0076] In another embodiment, the country name information directly determined from the marked sequence can be compared with the country name information obtained from the remaining sequence after the country name entity is removed, and the country name information in the message to be identified can be determined based on the comparison result.

[0077] In the above two implementations, when the country name information cannot be determined from the annotation sequence, the recognition failure is directly output, and a prompt message can be generated to prompt additional operations for further recognition, thereby achieving timely feedback on the situation where the country name information does not exist in the MT message, which is convenient for the staff to handle it in a timely manner.

[0078] In the above-mentioned country name information extraction method, for the message to be identified, a word vector corresponding to each word in the message to be identified is generated; then, according to the word vector corresponding to each word, the context feature of each word is extracted; further, according to the context feature of each word, each word is matched with a preset label sequence to obtain a label sequence containing each word and the label corresponding to each word; finally, according to the label sequence, the country name information in the message to be identified is determined. In this method, by converting the words in the message to be identified into word vectors, extracting the context features, and then matching the label sequence to determine the country name information, the semantics of each word and the context information of the word in the sentence are fully considered, so that the meaning and role of each word in the sentence can be more fully understood, and the understanding and recognition ability of the word can be improved, so as to help the matching process accurately determine the label of each word, thereby improving the accuracy and effect of the entity recognition of the country name information. Moreover, this method can realize the intelligent recognition of country name entities through word vector representation, context feature extraction, label sequence matching and annotation sequence determination of the country name information process, reduce unnecessary calculation and processing steps, improve recognition efficiency, speed up the recognition speed of country name information entities, and thus improve the overall recognition efficiency.

[0079] In an exemplary embodiment, the word vector corresponding to each word in the message to be recognized is generated in the above step S110, including: performing word segmentation processing on the message to be recognized to obtain multiple words contained in the message to be recognized; obtaining the word vector corresponding to each word through a pre-trained word embedding model to obtain the word vector corresponding to each word in the message to be recognized.

[0080] The word embedding model can be a Word2Vec model, which is used to reduce the dimension of the data and train it according to the context in the text. Word2Vec includes two models: the continuous bag of words model and the skip word model. Figure 2 , Figure 2 (a) is a schematic diagram of the structure of the continuous bag of words model. Figure 2 (b) is a schematic diagram of the structure of the word skipping model. Figure 2 As can be seen from the figure, the continuous bag of words model refers to the use of words The words before and after Predict words , the skip-word model refers to using words Predicting the next and next words Therefore, in practical applications, the Word2Vec model can be trained in advance, and the text content of 50K items of MT103 message can be input into the Word2Vec model to obtain the word vector corresponding to each word.

[0081] More specifically, before processing the message to be identified through the pre-trained word embedding model, the text information contained in the message to be identified can be extracted first, and then the text information is segmented to split it into individual words or punctuation marks. For each segmented word, the pre-trained word embedding model is queried to obtain its corresponding word vector representation. For vocabulary that may not be covered by the pre-trained word embedding model, it can be represented by randomly initializing the vector or using special tags.

[0082] In this embodiment, each word in the message to be identified can be mapped to a vector representation in a high-dimensional real number vector space through a word embedding model. These vectors capture the semantic relationship between words. Through this representation, the similarity and correlation between words can be better understood, thereby facilitating a better understanding of the contextual information of the country name information and improving the accuracy of the recognition of the country name information.

[0083] In an exemplary embodiment, in the above step S120, context features of the message to be identified are extracted based on the word vector corresponding to each word, specifically including: inputting the word vector corresponding to each word into a convolutional neural network, and extracting local features around each word through the convolutional neural network; inputting the local features around each word into a bidirectional long short-term memory network, and extracting the context features of each word through the bidirectional long short-term memory network.

[0084] Among them, the Convolutional Neural Network (CNN) can extract the relationship between words in the text. By training with input text, it can obtain the weights that distinguish the importance of different words. CNN mainly includes convolutional layer, pooling layer and fully connected layer. The structure is as follows Figure 3As shown in the figure, the convolution layer uses the convolution kernel to scan the input text data, extract the local features of the text data, and generate a feature vector. Specifically, the convolution kernel performs a convolution operation on the text data. The width and number of features extracted by the convolution operation can be controlled by changing the size and step size of the convolution kernel. The pooling layer is a common operation of convolutional neural networks. Its purpose is to reduce the output data and retain the text feature information. The pooling operation can be divided into maximum pooling and average pooling. Maximum pooling divides the feature matrix into several non-overlapping rectangular areas, and takes the maximum value of each area as the representative of the area for output, thereby reducing the size of the feature matrix while retaining the feature information. Average pooling is similar to maximum pooling, except that the average value of each area is taken for output. The fully connected layer connects all neurons in the previous layer to each neuron in the current layer, and sets weights for each connection. When the fully connected layer is output, an activation function is used for nonlinear mapping. Common activation functions include ReLU, sigmod, and tanh.

[0085] Among them, the Long Short-Term Memory (LSTM) neural network is an improvement on the Recurrent Neural Network (RNN) and can solve the problems of gradient disappearance and gradient explosion. The structure of LSTM is as follows Figure 4 As shown in the figure, when using LSTM for text processing, each moment The input contains an input quantity , the hidden output corresponding to the previous moment and cell status , the output includes the current hidden output and the current cell state LSTM introduces three gate structures based on RNN, namely input gate, forget gate and output gate. The input gate controls the degree of information input into the state unit, the forget gate controls the proportion of retained information, and the output gate is used to calculate the hidden state, which contains the input information.

[0086] Forget Gate The calculation formula is: ,in, and is the weight matrix of the forget gate, is the bias term of the forget gate and uses the sigmoid function Get a value between 0 and 1 to forget the previous cell state.

[0087] Input Gate The calculation formula is: ,in, and is the weight matrix of the forget gate, It is the bias term of the forget gate, which is calculated using the sigmoid function to determine the effect of the input value on the cell state. Updates.

[0088] Output Gate The calculation formula is: ,in, and is the weight matrix of the forget gate, It is the bias term of the forget gate, which is calculated using the sigmoid function to determine the updated cell state. For hidden state degree of impact.

[0089] In the picture For input The generated status information is calculated as follows: ,in, and is the weight matrix, is the bias term.

[0090] Current cell status The calculation method is: .

[0091] Current hidden state for: .

[0092] By saving the hidden state , can save information that needs long-term memory and can better express the dependency relationship between words in the input text.

[0093] The LSTM model can use the information before the word to update the state, but cannot combine the information after the word. The bidirectional long short-term memory network (BILSTM) can obtain the information before and after the word. Its structure is as follows: Figure 5 As shown, from Figure 5 As can be seen in the figure, BiLSTM inputs the input sequence into the forward LSTM and the backward LSTM respectively, and concatenates the hidden vectors in the two directions as the output, which can fully utilize the input text sequence information and improve the recognition accuracy.

[0094] In the specific implementation, the word vector corresponding to each word in the message to be identified is input into the convolutional neural network, and the local features around each word are extracted through the convolution operation. The extracted features are downsampled or aggregated through the pooling operation, and then the local features around each word extracted by the CNN are input into the bidirectional long short-term memory network. The bidirectional long short-term memory network consists of a forward LSTM and a reverse LSTM, which can capture the context information of the word. The bidirectional long short-term memory network performs a bidirectional scan on each input word sequence and extracts the context features of each word, which can effectively capture long-distance dependencies.

[0095] In this embodiment, a convolutional neural network is used to obtain local features around each word, and a bidirectional long short-term memory network is used to extract context features of each word. By combining the advantages of the two models, the local features and long-term dependencies around the words are fully utilized to extract rich context features of each word, thereby better understanding the semantic information of each word in the message to be identified.

[0096] In an exemplary embodiment, in the above step S130, each word is matched with a preset label sequence according to the context features of each word to obtain a label sequence including each word and the label corresponding to each word, including: inputting the context features of each word and the preset label sequence into a conditional random field, matching each word with the preset label sequence through the conditional random field, and outputting the label sequence.

[0097] Among them, the Conditional Random Field (CRF) is a discriminative probability model and a special Markov random field. It can obtain the dependency between adjacent labels, calculate the probability of the optimal label sequence, and output the labeling result of the text sequence.

[0098] In the specific implementation, the conditional random field can be trained in advance through the context features of sample messages and each word in the sample message. The main goal of training the conditional random field model is to maximize the conditional probability, that is, to find the most likely label sequence given the input sequence. Specifically, the context features of each word in the sample message and the preset label sequence are used as input variables, and the real label sequence of the sample message is used as the supervision information for training. The context features of each word in the sample message are input into the conditional random field to be trained, and the predicted label sequence is output. The parameters of the conditional random field are trained based on the loss value between the predicted label sequence and the real label sequence until the loss value converges, and the training is terminated, so that the conditional random field learns how to predict the label sequence based on the relationship between the input features and the label sequence.

[0099] After the training is completed, the context features of each word and the preset label sequence are input into the conditional random field network, and each word is matched with the preset label sequence through the conditional random field to output the optimal label sequence.

[0100] When matching in a conditional random field, the specific calculation method is:

[0101] Suppose the context features of each word form a sequence , the label sequence is , the scoring formula is expressed as:

[0102]

[0103] in, is from Transfer to The probability of The i-th word is labeled probability.

[0104] Perform softmax on the score and get:

[0105]

[0106] Since some combinations in the label sequence are impossible, such as the province followed by the account number, we need to introduce a transfer feature function and state characteristic function , with a value of 1 or 0, is used to exclude some situations that will not exist. can be written as:

[0107]

[0108] Among them, the normalization factor for:

[0109]

[0110] in, , are the transfer characteristic function and the state characteristic function respectively, and is the corresponding weight.

[0111] According to the probability of label sequence Select the label item for the vocabulary.

[0112] In this embodiment, by training the conditional random field model, the conditional random field model can learn the relationship between the input features and the label sequence, so that the optimal label sequence can be accurately predicted in the prediction stage.

[0113] In an exemplary embodiment, if Figure 6 As shown, in the above step S140, according to the marking sequence, determining the country name information in the message to be identified specifically includes:

[0114] Step S141, determining the first country name information from the annotation sequence;

[0115] Step S142, removing the country name entity tag and the words corresponding to the country name entity tag from the annotation sequence to obtain a processed sequence, and determining the second country name information according to the processed sequence;

[0116] Step S143, determining the country name information in the message to be identified according to the first country name information and the second country name information.

[0117] In a specific implementation, the country name information directly determined from the annotation sequence, that is, the country name information that can be directly determined based on the label in the annotation sequence, can be used as the first country name information. Then, the country name entity label and the vocabulary corresponding to the country name entity label are removed from the annotation sequence to obtain a processed sequence, and the country name information determined based on the processed sequence is used as the second country name information. The consistency between the first country name information and the second country name information is further compared, and the country name information in the message to be identified is determined based on the comparison result.

[0118] In this embodiment, considering that information other than the country name entity in the MT message, such as the address, can also indirectly identify the country name information, therefore, on the one hand, the first country name information is directly determined from the marked sequence, and on the other hand, the second country name information is determined based on the remaining sequence except the country name, and the country name information in the message to be identified is determined based on the comparison result of the two country name information, which can improve the accuracy of the identified country name information.

[0119] In an exemplary embodiment, the above step S143 determines the country name information in the message to be identified according to the first country name information and the second country name information, and specifically includes:

[0120] When the first country name information and the second country name information are the same, determining the first country name information or the second country name information as the country name information in the message to be identified;

[0121] When the first country name information and the second country name information are different, the first country name information, the second country name information, and prompt information are output; the prompt information is used to prompt further identification operations.

[0122] In a specific implementation, when the first country name information directly identified from the annotation sequence and the second country name information indirectly identified from the remaining sequence excluding the country name entity are the same, it indicates that the recognition result is relatively accurate. At this time, the first country name information or the second country name information can be directly output as the country name information in the message to be identified.

[0123] When the first country name information directly identified from the annotation sequence and the second country name information indirectly identified from the remaining sequence excluding the country name entity are different, it indicates that there is doubt in the identification result. At this time, the first country name information or the second country name information can be output at the same time, and a prompt message can be output to prompt the staff to perform additional operations for further identification.

[0124] In this embodiment, only when the first country name information and the second country name information are the same, the country name information in the message to be identified is determined to be the first country name information or the second country name information; when the first country name information and the second country name information are not the same, the staff is prompted to perform further identification operations. This method determines the final country name information based on the consistency comparison results of the country name information determined in two ways, which can further improve the accuracy of the determined country name information.

[0125] In an exemplary embodiment, determining the second country name information according to the processed sequence in the above step S142 specifically includes: inputting the processed sequence into a trained country recognition network to obtain the second country name information corresponding to the processed sequence.

[0126] In a specific implementation, a data set can be prepared in advance, and a country identification network can be trained through the data set. The country identification network can determine the country name information by identifying information such as account number, name, address (including province, city, county, street, etc.). The specific training process may include: preparing a data set, which includes information such as account number, name, address, etc. of the sample message, and the real country name information marked on the sample message. In each training iteration, the account number, name, address, etc. of the sample message is used as an input variable, input into the country identification network to be trained, and the predicted country name information is output. The loss between the predicted country name information and the real country name information is calculated, and the model parameters are updated for the purpose of reducing the loss until the model converges or reaches the set number of training rounds, and the training is terminated to obtain a trained country identification network.

[0127] When applied, the processed sequence corresponding to the message to be identified after the country name entity is removed can be input into the country identification network to obtain the second country name information corresponding to the processed sequence.

[0128] In this embodiment, by training an entity recognition network specifically for country name information, the recognition accuracy of account numbers, names, addresses, etc. can be improved. The trained entity recognition network can automatically recognize account numbers, names, addresses, etc. from text without the need for manual search and annotation, thereby improving recognition efficiency and processing speed.

[0129] In one embodiment, in order to facilitate those skilled in the art to understand the embodiments of the present application, the following will be described with reference to specific examples of the accompanying drawings. Figure 7 , shows a schematic diagram of the overall structure of a country name entity recognition model for extracting country name information in MT103 messages, such as Figure 7 As shown in the figure, the country name entity recognition model includes a four-layer structure: the first layer is the embedding layer, which uses the Word2Vec pre-training model to extract the semantic information of 50K items of MT103 messages, and generates the word vector of each word in conjunction with the context information; the second layer is the feature extraction layer, including the convolutional neural network (CNN) layer and the bidirectional long short-term memory network (BiLSTM) layer, which uses CNN to extract local feature information around each word, and the BiLSTM network extracts the previous context features through the forward LSTM and the following context features through the backward LSTM. After the CNN layer and the BILSTM layer, text feature extraction is realized; the third layer is the conditional random field (CRF) layer, which uses the feature sequence output by the feature extraction layer and combines the CRF for decoding to obtain the best annotation sequence; the fourth layer is the judgment layer, which removes the country name entity from the obtained annotation sequence, inputs it into the country recognition network, identifies the country name information, compares it with the country name information directly obtained from the annotation sequence, and outputs the final result.

[0130] against Figure 7 The country name entity recognition model shown can be regarded as a whole for model evaluation, using evaluation indicators such as precision (Precision, P), recall (Recall, R), F1 value, etc. for evaluation.

[0131] The accuracy rate refers to the ratio of the number of correctly labeled country name entities in the output to the total number of labeled country name entities in the output. The calculation formula is:

[0132]

[0133] in, Indicates a correct positive example, the entity is a positive class, and the label is also a positive class, Indicates a false positive example, the entity is the negative class and is marked as the positive class.

[0134] The recall rate refers to the ratio of the number of correctly labeled country name entities to the number of country name entities in all texts. The calculation formula is:

[0135]

[0136] in, Refers to a false negative example, the entity is a positive class, and is marked as a negative class.

[0137] The F1 value is the weighted average of precision and recall, which can be used to judge model performance. The calculation formula is:

[0138]

[0139] In summary of practical applications, we can use 50K text items of MT103 messages to create a data set for training and testing, and use the F1 value as the model evaluation indicator. When the F1 value is greater than the threshold, such as 90%, it can be considered that the model performance is good.

[0140] The method for extracting country name entity information in the MT103 message provided in this embodiment can realize accurate identification of country name entity information and ensure identification accuracy; at the same time, the method has good scalability, and the model proposed by the method can check the country name information in the message for various bank businesses, which is of great significance for banks to realize the automation of related businesses; the method also has strong applicability, not only applicable to the 50K items of the MT103 message, but also applicable to similar requirements of other MT messages; in addition, on the basis of proposing to identify 50K items of entities, the application adds a judgment operation, and only correctly outputs the country name entity information identified according to the country identification network and the country name entity information directly identified according to the annotation sequence when it is consistent, which can avoid the occurrence of erroneous output.

[0141] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0142] Based on the same inventive concept, the embodiment of the present application also provides a country name information extraction device for implementing the country name information extraction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more country name information extraction device embodiments provided below can refer to the limitations of the country name information extraction method above, and will not be repeated here.

[0143] In one embodiment, Figure 8 As shown, a device for extracting country name information is provided, including: a word vector generation module 810, a feature extraction module 820, a vocabulary label matching module 830 and an entity recognition module 840, wherein:

[0144] A word vector generation module 810 is used to generate a word vector corresponding to each word in the message to be recognized;

[0145] A feature extraction module 820 is used to extract context features of each word according to the word vector corresponding to each word;

[0146] The vocabulary label matching module 830 is used to match each vocabulary with a preset label sequence according to the contextual features of each vocabulary, and obtain a label sequence including each vocabulary and the label corresponding to each vocabulary;

[0147] The entity identification module 840 is used to determine the country name information in the message to be identified according to the marking sequence.

[0148] In one embodiment, the word vector generation module 810 is further used to perform word segmentation processing on the message to be recognized to obtain multiple words contained in the message to be recognized;

[0149] The word vector corresponding to each word is obtained through the pre-trained word embedding model, and the word vector corresponding to each word in the message to be recognized is obtained.

[0150] In one embodiment, the feature extraction module 820 is also used to input the word vector corresponding to each word into a convolutional neural network, and extract the local features around each word through the convolutional neural network; input the local features around each word into a bidirectional long short-term memory network, and extract the context features of each word through the bidirectional long short-term memory network.

[0151] In one embodiment, the entity identification module 840 is also used to determine the first country name information from the annotation sequence; remove the country name entity tag and the vocabulary corresponding to the country name entity tag from the annotation sequence to obtain a processed sequence, and determine the second country name information based on the processed sequence; determine the country name information in the message to be identified based on the first country name information and the second country name information.

[0152] In one of the embodiments, the entity identification module 840 is also used to, when the first country name information and the second country name information are the same, determine the first country name information or the second country name information as the country name information in the message to be identified; when the first country name information and the second country name information are different, output the first country name information, the second country name information, and prompt information; the prompt information is used to prompt to take further identification operations.

[0153] In one embodiment, the entity recognition module 840 is further used to input the processed sequence into a trained country recognition network to obtain the second country name information corresponding to the processed sequence.

[0154] In one embodiment, the vocabulary label matching module 830 is further used to input the contextual features of each vocabulary and a preset label sequence into a conditional random field, match each vocabulary with the preset label sequence through the conditional random field, and output the label sequence.

[0155] Each module in the above-mentioned country name information extraction device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0156] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data in the process of extracting country name information. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for extracting country name information is implemented.

[0157] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0158] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0159] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0160] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0161] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0162] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0163] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0164] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for extracting country name information, It is characterized in that The method comprises: Generate a word vector corresponding to each word in the message to be recognized; Extracting context features of each of the words according to the word vector corresponding to each of the words; According to the context features of each of the words, each of the words is matched with a preset label sequence to obtain a label sequence including each of the words and the label corresponding to each of the words; According to the marking sequence, the country name information in the message to be identified is determined.

2. The method according to claim 1, It is characterized in that The generating of a word vector corresponding to each word in the message to be identified includes: Performing word segmentation processing on the message to be identified to obtain a plurality of words contained in the message to be identified; The word vector corresponding to each word is obtained through the pre-trained word embedding model, and the word vector corresponding to each word in the message to be identified is obtained.

3. The method according to claim 1, It is characterized in that The extracting the context features of the message to be identified according to the word vector corresponding to each of the words includes: Inputting the word vector corresponding to each of the words into a convolutional neural network, and extracting local features around each of the words through the convolutional neural network; The local features around each of the words are input into a bidirectional long short-term memory network, and the context features of each of the words are extracted through the bidirectional long short-term memory network.

4. The method according to claim 1, It is characterized in that The step of determining the country name information in the message to be identified according to the marking sequence includes: Determining first country name information from the tag sequence; Remove the country name entity tag and the vocabulary corresponding to the country name entity tag from the marked sequence to obtain a processed sequence, and determine the second country name information according to the processed sequence; The country name information in the message to be identified is determined according to the first country name information and the second country name information.

5. The method according to claim 4, It is characterized in that Determining the country name information in the message to be identified according to the first country name information and the second country name information includes: When the first country name information and the second country name information are the same, determining the first country name information or the second country name information as the country name information in the message to be identified; When the first country name information and the second country name information are different, the first country name information, the second country name information, and prompt information are output; the prompt information is used to prompt further identification operations.

6. The method according to claim 4, It is characterized in that Determining the second country name information according to the processed sequence includes: The processed sequence is input into a trained country recognition network to obtain second country name information corresponding to the processed sequence.

7. A device for extracting country name information, It is characterized in that The device comprises: A word vector generation module is used to generate a word vector corresponding to each word in the message to be recognized; A feature extraction module, used to extract context features of each of the words according to the word vector corresponding to each of the words; A vocabulary label matching module, used to match each of the words with a preset label sequence according to the contextual features of each of the words, to obtain a label sequence including each of the words and the label corresponding to each of the words; The entity identification module is used to determine the country name information in the message to be identified based on the marking sequence.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method for extracting country name information according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method for extracting country name information according to any one of claims 1 to 6 are implemented.

10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method for extracting country name information described in any one of claims 1 to 6 are implemented.