Chinese text multi-classification-based fraud-related website identification method

By combining the multi-step processing of WoBERT, CRNN and LSTM models, the problems of unintelligent word segmentation and low model efficiency in existing Chinese text recognition methods are solved, accurate classification of Chinese texts is achieved, and the accuracy and accuracy of Chinese text recognition are improved. Efficiency provides strong support for Internet security.

CN118535735APending Publication Date: 2024-08-23HOHAI UNIV

Patent Information

Application Number
CN202410717877.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing Chinese text recognition methods have problems such as unintelligent word segmentation, low model efficiency, and difficulty in data conversion in the Chinese context, resulting in biased overall understanding of Chinese texts and inaccurate classification results.

Method used

Using a multi-step processing method based on WoBERT and CRNN models, combined with Chinese word segmentation, word embedding, LSTM model and CNN module, through multi-layer coding and feature extraction, accurate classification of Chinese texts is achieved.

Benefits of technology

It has improved the accuracy and efficiency of Chinese text classification, can better adapt to the Chinese environment, effectively identify and classify fraudulent websites, and provide support for Internet security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535735A
    Figure CN118535735A
Patent Text Reader

Abstract

The invention relates to a fraud-related website identification method based on Chinese text multi-classification, which belongs to the technical field of internet security and comprises the following steps: S1, acquiring a plurality of Chinese texts of a website and preprocessing the Chinese texts; s2, performing Chinese word segmentation and word embedding on the preprocessed Chinese text, coding a word segmentation result, and adjusting the word segmentation result into an integer sequence list with consistent length; s3, encoding the integer sequence list and outputting a language vector; s4, performing feature extraction on the language vector, and converting the language vector into a language feature vector; s5, processing the language feature vector, and outputting a hidden state feature vector; s6, performing feature extraction on the hidden state feature vector and outputting a result; s7, transmitting a feature extraction result to a softmax activation function, and converting the feature extraction result into probability distribution; and S8, selecting the category with the maximum probability as a classification result of the Chinese text. According to the method, not only is a word segmentation device optimized, but also accurate classification of Chinese texts is realized through multi-step processing in combination with a WoBERT model and a CRNN model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of Internet security technology, and in particular relates to a method for identifying fraudulent websites based on multi-classification of Chinese texts. Background Art

[0002] Existing Chinese text recognition, such as a Chinese text classification method based on BERT and CNN hierarchical connection disclosed in authorization announcement number CN111177376B, mainly adopts the Bert model.

[0003] The Chinese word segmentation of the Bert model is not smart enough. There are problems such as simply dividing the text into individual characters and forcibly converting full-width symbols. In the Chinese context, a single character usually cannot express complete semantics independently. When a sentence is broken down into individual characters, the semantic association between words is lost, which affects semantic understanding and context analysis. This situation can easily lead to a deviation in the model's overall understanding of the text, which in turn affects the accuracy of the evaluation results.

[0004] Moreover, the existing technology can only combine two models. It is not easy to solve the problems of model efficiency and data conversion when combining more models. Summary of the invention

[0005] The fraud-related URL identification method based on multi-classification of Chinese text of the present invention can better adapt to the Chinese environment. It not only optimizes the word segmenter, but also combines the WoBERT and CRNN models. Through multi-step processing, it realizes the accurate classification of Chinese text.

[0006] In order to achieve the above object, the method for identifying fraudulent websites based on Chinese text multi-classification of the present invention is characterized by comprising the following steps: S1: obtaining multiple Chinese texts of the URLs and preprocessing the Chinese texts of the URLs; S2: Perform Chinese word segmentation and word embedding on the preprocessed Chinese text, encode the segmentation results and adjust them to a list of integer sequences with the same length; S3: Use the WoBERT module to encode the integer sequence list in S2 and output a language vector with high-level semantic information; S4: Use the CNN module to extract features from the language vector and convert it into a language feature vector; S5: Process the language feature vector in S4 using the RNN module and output the hidden state feature vector; S6: Input the hidden state feature vector in S5 into the fully connected layer, and use the fully connected layer to output the feature extraction result; S7: pass the feature extraction result in S6 to the softmax activation function, which converts the full feature extraction result into a probability distribution, with each category corresponding to a probability value; S8: Select the category with the highest probability as the classification result of the Chinese text.

[0007] Further, step S3 includes the following steps: S3.1: Input the integer sequence list into the WoBERT module and convert it into word vectors through the Embedding layer; S3.2: In the WoBERT module, encode the word vector in S3.1; S3.3: The encoded word vector is input into the multi-layer BERT encoder in the WoBERT module for processing, and a language vector containing high-level semantic information is output.

[0008] Further, step S4 includes the following steps: S4.1: The language vector is input into the CNN module, and the convolution layer of the CNN module performs a convolution operation on the language vector; S4.2: The pooling layer of the CNN module pools and reduces the dimension of the language vector after the convolution operation. The language vector after pooling and dimension reduction is recorded as the language feature vector.

[0009] Furthermore, in step S5, the LSTM model in the RNN module is used to perform forward and backward bidirectional encoding on the language feature vector, and the LSTM model outputs a hidden state feature vector containing a time step.

[0010] Furthermore, in step S6, feature extraction is performed using linear transformation and nonlinear activation function in the fully connected layer, and the fully connected layer outputs the feature extraction result.

[0011] Further, step S2 includes the following steps: S2.1: Use the Chinese word segmentation library jieba to segment each Chinese text and generate a list of words; S2.2: Traverse the words in the list after word segmentation in S2.1, and encode each word using Tokenizer; each word will be converted into a fixed-length integer sequence; S2.3: adjust the integer sequences in the integer sequence list in S2.2 to the same length by padding or truncating; S2.4: Save the padded or truncated integer sequence list in S2.3 and the encoding rules in S2.2 in a pickle file.

[0012] Furthermore, the preprocessing in step S1 includes: removing null value data, removing text with found features, and removing meaningless text. Beneficial Effects

[0013] 1. This method uses the LSTM model in S5 to perform forward and backward bidirectional encoding on the language feature vector in the WoBERT module, RNN module and CNN module, solving the problem that the WoBERT module, RNN module and CNN module cannot be integrated.

[0014] 2. Compared with the existing text classification methods in the background technology, the present invention is more suitable for the Chinese context. It not only optimizes the word segmenter, but also combines the WoBERT and CRNN models. Through multi-step processing, it realizes the accurate classification of Chinese text. The invention can effectively identify and classify fraudulent websites, providing strong support for Internet security. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is a flow chart of the whole method. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0017] The method for identifying fraudulent websites based on Chinese text multi-classification includes the following steps: S1: Obtain the Chinese text of the URL and pre-process the Chinese text of the URL. Specifically, the following steps are included: Specifically, a Python crawler is used to obtain multiple Chinese texts of the URL, and all the null value data, texts with found features, and meaningless texts are removed from the Chinese texts.

[0018] Specifically, the removal of null value data is to use the dropna() method in the Pandas library to remove null value data in Chinese text.

[0019] To remove the data of the found features, a predefined feature list is used. By traversing the Chinese text and matching the keywords in the feature list, Python's re module is used for regular expression matching to remove the text of the found features.

[0020] Removing meaningless text is to determine whether the text is meaningless by setting a threshold based on the length of the Chinese text, the proportion of special characters, and other rules. For example, if the text length is less than 5 characters or the proportion of special characters is greater than 50%, the text is considered meaningless. For meaningless Chinese text, it is directly deleted, and this step is implemented using Python string operations and conditional judgments.

[0021] S2: Perform Chinese word segmentation and word embedding on the preprocessed Chinese text, encode the segmentation results and adjust them into a list of integer sequences with the same length.

[0022] The specific steps include: S2.1: Use the Chinese word segmentation library jieba to segment each Chinese text and generate a list of words. For example, the Chinese text is: "I love learning", and the result after word segmentation is ["I", "love", "learning"].

[0023] S2.2: Traverse the words in the list after word segmentation in S2.1, and encode each word using Tokenizer; each word will be converted into an integer sequence of fixed length. At this point, the entire Chinese text is an integer sequence list containing integer sequences.

[0024] S2.3: Adjust the integer sequences in the integer sequence list in S2.2 to the same length by padding or truncating.

[0025] Specifically, if the length of the integer sequence of a word is insufficient, a special padding symbol (such as 0) is added to the end of the integer sequence of the word to reach the predetermined length. If the length of a word sequence exceeds the predetermined length, the excess part is truncated.

[0026] S2.4: Save the list of integer sequences after padding or truncation in S2.3 and the encoding rules in S2.2 in a pickle file. The above word embedding refers to converting text into integer representations of words.

[0027] S3: Use the WoBERT module to encode the integer sequence list in S2 and output a language vector with high-level semantic information.

[0028] The specific steps include: S3.1: Input the list of integer sequences into the WoBERT module and convert them into word vectors through the Embedding layer.

[0029] S3.2: In the WoBERT module, the word vectors in S3.1 are encoded. The encoding process uses the Multi-Head Self-Attention mechanism.

[0030] S3.3: The encoded word vector is input into the multi-layer BERT encoder in the WoBERT module for processing, and a language vector containing high-level semantic information is output.

[0031] S4: Use the CNN module to extract features from the language vector and convert it into a language feature vector.

[0032] The specific steps include: S4.1: The language vector is input into the CNN module, and the convolution layer of the CNN module performs a convolution operation on the language vector.

[0033] S4.2: The pooling layer of the CNN module pools and reduces the dimension of the language vector after the convolution operation. The language vector after pooling and dimension reduction is recorded as the language feature vector.

[0034] S5: Process the language feature vector in S4 using the RNN module and output the hidden state feature vector.

[0035] Specifically, the LSTM model in the RNN module is used to perform forward and backward bidirectional encoding on the language feature vector, and the LSTM model outputs a hidden state feature vector containing time steps.

[0036] S6: Input the hidden state feature vector into the fully connected layer and use the fully connected layer to output the feature extraction result.

[0037] Specifically, in the fully connected layer, the hidden state feature vector is extracted through linear transformation and nonlinear activation function (such as ReLU), and the fully connected layer outputs the feature extraction result.

[0038] The LSTM also contains GlobalAveragePoolinglD and Dropout layers. The LSGlobalAveragePoolinglD layer performs an average pooling operation on each time step of the sequence, converting the output of each time step into a fixed-length vector. Finally, a Dropout layer is added to the model with a Dropout ratio of 0.2 to prevent overfitting.

[0039] The role of this RNN is to process the sequence data output by CNN. The Bidirectio nal LSTM layer can capture the long-term dependencies in the sequence, and the model can learn the forward and reverse information of the input sequence at the same time by using a bidirectional structure. The GlobalAveragePooling1D layer can convert the output of each time step of the sequence into a fixed-length vector, which helps improve the model's ability to understand the input text. The Dropout layer can help prevent overfitting and improve the generalization ability of the model.

[0040] S7: Pass the feature extraction results in S6 to the softmax activation function. The softmax function converts the output feature extraction results of the fully connected layer into a probability distribution, and each category corresponds to a probability value. Categories refer to different classification labels, including 13 labels such as normal websites and shopping consumption.

[0041] S8: Select the category with the highest probability as the classification result of the Chinese text.

[0042] The present invention adopts a fraud-related website identification method based on Chinese text multi-classification, and realizes efficient and accurate text classification by combining the WoBERT module, CNN module and RNN module. This method innovatively combines three different deep learning models, fully utilizing their respective advantages and improving the accuracy and efficiency of text classification. Since the principles and implementation methods of these three are relatively complex and different, it is difficult to think of combining them under conventional thinking. It is this cross-domain integration that gives the present invention a significant technical advantage in the identification of fraud-related websites.

[0043] The innovation of this solution lies in the combination of WoBERT module, CNN module and RNN module. General text classification methods, such as the Chinese text classification method based on BERT and CNN hierarchical connection mentioned in the background technology, only combine WoBERT module and CNN module. As for not combining RNN module, it is because the fusion of three models involves data conversion and parameter adjustment. This solution first uses the LSTM model in the RNN module in S5 to perform bidirectional encoding and convert it into a hidden state feature vector, and then inputs the hidden state feature vector into the fully connected layer, which solves the problem of data conversion.

[0044] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. A fraudulent website identification method based on Chinese text multi-classification, characterized in that: The following steps are involved: S1: obtaining multiple Chinese texts of the URLs and preprocessing the Chinese texts of the URLs; S2: Perform Chinese word segmentation and word embedding on the preprocessed Chinese text, encode the segmentation results and adjust them to a list of integer sequences with the same length; S3: Use the WoBERT module to encode the integer sequence list in S2 and output a language vector with high-level semantic information; S4: Use the CNN module to extract features from the language vector and convert it into a language feature vector; S5: Process the language feature vector in S4 using the RNN module and output the hidden state feature vector; S6: Input the hidden state feature vector in S5 into the fully connected layer, and use the fully connected layer to output the feature extraction result; S7: pass the feature extraction result in S6 to the softmax activation function, which converts the full feature extraction result into a probability distribution, with each category corresponding to a probability value; S8: Select the category with the highest probability as the classification result of the Chinese text.

2. The fraudulent website identification method based on Chinese text multi-classification according to claim 1 is characterized in that: Step S3 includes the following steps: S3.1: Input the integer sequence list into the WoBERT module and convert it into word vectors through the Embedding layer; S3.2: In the WoBERT module, encode the word vector in S3.1; S3.3: The encoded word vector is input into the multi-layer BERT encoder in the WoBERT module for processing, and a language vector containing high-level semantic information is output.

3. The fraudulent website identification method based on Chinese text multi-classification according to claim 2 is characterized in that: Step S4 includes the following steps: S4.1: The language vector is input into the CNN module, and the convolution layer of the CNN module performs a convolution operation on the language vector; S4.2: The pooling layer of the CNN module pools and reduces the dimension of the language vector after the convolution operation. The language vector after pooling and dimension reduction is recorded as the language feature vector.

4. The fraudulent website identification method based on Chinese text multi-classification according to claim 3 is characterized in that: In step S5, the LSTM model in the RNN module is used to perform forward and backward bidirectional encoding on the language feature vector, and the LSTM model outputs a hidden state feature vector containing a time step.

5. The fraudulent website identification method based on Chinese text multi-classification according to claim 4 is characterized in that: In step S6, feature extraction is performed using linear transformation and nonlinear activation function in the fully connected layer, and the fully connected layer outputs the feature extraction result.

6. The fraudulent website identification method based on Chinese text multi-classification according to claim 5 is characterized in that: Step S2 includes the following steps: S2.1: Use the Chinese word segmentation library jieba to segment each Chinese text and generate a list of words; S2.2: Traverse the words in the list after word segmentation in S2.1, and encode each word using Tokenizer; each word will be converted into a fixed-length integer sequence; S2.3: adjust the integer sequences in the integer sequence list in S2.2 to the same length by padding or truncating; S2.4: Save the padded or truncated integer sequence list in S2.3 and the encoding rules in S2.2 in a pickle file.

7. The fraudulent website identification method based on Chinese text multi-classification according to claim 1 is characterized in that: The preprocessing in step S1 includes: removing null value data, removing text with found features, and removing meaningless text.

Citation Information

Patent Citations

  • A Chinese text classification method based on BERT and CNN hierarchical connections

    CN111177376B

Cited By

  • Timestamp obtaining method and device of voice recognition result, equipment and program product

    CN122290600A