Domain name classification method, device and computer readable storage medium
By extracting domain name page tag features and combining the domain name classification model with a recursive regularization structure, the problem of low domain name classification accuracy in the existing technology is solved, and more efficient domain name type identification is achieved.
Patent Information
- Application Number
- CN202110305374.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-22
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-03-22
AI Technical Summary
Existing domain name classification methods are not very accurate, and it is difficult to discover the relationship between different types of domain names, resulting in inaccurate classification results.
By extracting the page tag features of the domain name to be classified as model input, the pre-trained target domain name classification model with recursive regularization function is used to analyze hierarchical dependencies and combine the regularization structure for model parameter estimation to improve the accuracy of domain name classification.
It improves the accuracy of domain name classification, reduces the complexity of feature engineering, can effectively mine hierarchical dependencies between domain name types, enhances the similarity of model parameters, and improves the accuracy of classification results.
Smart Images

Figure CN113076453B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine learning technology, and in particular to a domain name classification method, device and computer-readable storage medium. Background Art
[0002] Domain classification is the process of assigning domain names to one or more predefined categories. It plays an important role in content recommendation, network analysis of specific topics, and contextual search optimization. According to the different category labels, the domain classification problem can be divided into domain name subject classification, domain name function type classification, and other different problems. Domain name function type can be regarded as the functional label provided by the domain name to users, such as online shopping, news media, government organizations, resource downloads, and search engines. The purpose of online shopping websites is to provide users with an interface for searching products and allow users to shop and pay online.
[0003] Existing domain name classification methods based on functional types usually focus on feature engineering and rely on different types of features. They do not reveal enough about the relationships between domain name types and find it difficult to discover the relationships between different types of domain names, which leads to the technical problem of low accuracy of domain name classification. Summary of the invention
[0004] The main purpose of the present invention is to provide a domain name classification method, device and computer-readable storage medium, aiming to solve the technical problem that the domain name classification accuracy of the existing domain name classification method is not high.
[0005] To achieve the above object, the present invention provides a domain name classification method, which includes:
[0006] Obtaining a domain name to be classified, and extracting page tag features of the domain name to be classified;
[0007] Inputting the page tag features into a pre-trained target domain name classification model with a recursive regularization function, wherein a domain name category system with a hierarchical structure has been defined in the target domain name classification model;
[0008] Based on the target domain name classification model, analyzing the hierarchical dependency relationship between several domain name types related to the page tag features and corresponding to the domain name classification system;
[0009] The hierarchical dependency is used in combination with a regularized recursive structure to estimate model parameters, so as to obtain a target classification label for the domain name to be classified based on the domain name classification model after the model parameter estimation.
[0010] Optionally, the step of analyzing the hierarchical dependency relationship of several domain name types related to the page tag features on the domain name category system based on the target domain name classification model includes:
[0011] The convex loss function in the target domain name classification model is used to hierarchically classify the domain name types to obtain the hierarchical dependency relationship.
[0012] Optionally, the step of estimating model parameters by utilizing the hierarchical dependency relationship in combination with a regularized recursive structure includes:
[0013] Based on the recursive regularization method in the target domain classification model, the hierarchical dependency relationship is integrated into the regularization structure of the model parameters;
[0014] Model parameter estimation is performed based on the convex loss function, adjustment parameters and the regularization structure in the target domain name classification model.
[0015] Optionally, before the step of obtaining the domain name to be classified, the method further includes:
[0016] Crawl a domain name paging list in a specified website, traverse each domain name paging in the domain name paging list to obtain a sample domain name address, a sample domain name type and a sample domain name description information as domain name sample information;
[0017] According to the sample domain name addresses and the sample domain name types, the domain name types are divided into two levels: major categories and subcategories, so as to define the domain name classification system;
[0018] The domain name sample information is constructed into a domain name classification data set according to the domain name category system, and the domain name classification data set is trained based on a neural network model architecture to obtain the target domain name classification model, wherein the target domain name classification model includes an input layer, an embedding layer, an encoding layer and an output layer.
[0019] Optionally, the step of training the domain name classification data set based on a neural network model architecture to obtain the target domain name classification model includes:
[0020] The domain name classification data set is randomly divided into a training set, a validation set and a test set according to a preset ratio;
[0021] Training the training set to obtain an initial domain name classification model;
[0022] Using the validation set to verify whether the initial domain name classification model is overfitting;
[0023] If yes, determining whether the accuracy of the initial domain name classification model on the validation set meets a preset first standard;
[0024] If yes, determining whether the accuracy of the initial domain name classification model on the test set meets a preset second standard;
[0025] If so, the initial domain name classification model is used as the target domain name classification model.
[0026] Optionally, after the step of using the validation set to verify whether the initial domain name classification model is overfitting, the method further includes:
[0027] If not, continue training the initial domain name classification model;
[0028] After the step of determining whether the accuracy of the initial domain name classification model on the validation set meets the preset first standard, the method further includes:
[0029] If not, adjusting the model parameters of the initial domain name classification model, and retraining the initial domain name classification model after the model parameters are adjusted;
[0030] After the step of determining whether the accuracy of the initial domain name classification model on the test set meets the preset second standard, the method further includes:
[0031] If not, the domain name classification data set is re-divided to perform model training based on the re-divided domain name classification data set.
[0032] Optionally, the step of training the training set to obtain an initial domain name classification model includes:
[0033] At the input layer, converting the sample domain name and the sample domain name description information into an input text sequence in a specific form, so as to input the input text sequence into the embedding layer;
[0034] In the embedding layer, word embedding is performed on the input text sequence to obtain a word embedding result, so as to input the word embedding result into the encoding layer;
[0035] In the encoding layer, a preset bag-of-words model is used to capture local context information of the word embedding result, so that a preset linear classifier obtains an initial classification result based on the local context information, and the initial classification result is input into the output layer;
[0036] At the output layer, model parameters are estimated based on the initial classification results to obtain the initial domain name classification model.
[0037] Optionally, the step of obtaining the domain name to be classified and extracting the page tag features of the domain name to be classified includes:
[0038] Using crawler technology to simulate access to the domain name to be classified, extracting title information and description information of meta tags in the source code of the homepage of the domain name to be classified;
[0039] The title information and the description information are combined into a meta tag feature of the domain name to be classified to serve as the page tag feature.
[0040] In addition, to achieve the above-mentioned purpose, the present invention further provides a domain name classification device, the domain name classification device comprising:
[0041] A tag feature extraction module is used to obtain a domain name to be classified and extract page tag features of the domain name to be classified;
[0042] A label feature input module, used for inputting the page label feature into a pre-trained target domain name classification model with a recursive regularization function, wherein a domain name category system with a hierarchical structure has been defined in the target domain name classification model;
[0043] A hierarchical relationship analysis module, used to analyze the hierarchical dependency relationship between a plurality of domain name types related to the page tag features and the domain name category system based on the target domain name classification model;
[0044] The target label acquisition module is used to estimate the model parameters by using the hierarchical dependency relationship in combination with the regularized recursive structure, so as to obtain the target classification label of the domain name to be classified based on the domain name classification model after the model parameter estimation.
[0045] Optionally, the hierarchical relationship analysis module includes:
[0046] The hierarchical classification unit is used to perform hierarchical classification on the domain name types using the convex loss function in the target domain name classification model to obtain the hierarchical dependency relationship.
[0047] Optionally, the target tag acquisition module includes:
[0048] A recursive regularization unit, configured to incorporate the hierarchical dependency into a regularization structure of model parameters based on a recursive regularization method in the target domain name classification model;
[0049] Model parameter estimation is performed based on the convex loss function, adjustment parameters and the regularization structure in the target domain name classification model.
[0050] Optionally, the domain name classification device further includes:
[0051] The sample information crawling module is used to crawl the domain name paging list in the specified website, traverse each domain name paging in the domain name paging list to obtain the sample domain name address, sample domain name type and sample domain name description information as the domain name sample information;
[0052] A type hierarchical classification module, used to classify the domain name type into two levels, namely, a major category and a subcategory, according to the sample domain name address and the sample domain name type, so as to define the domain name classification system;
[0053] The target model training module is used to construct the domain name sample information into a domain name classification data set according to the domain name category system, and train the domain name classification data set based on the neural network model architecture to obtain the target domain name classification model, wherein the target domain name classification model includes an input layer, an embedding layer, an encoding layer and an output layer.
[0054] Optionally, the target model training module further includes:
[0055] A data partitioning unit, used for randomly dividing the domain name classification data set into a training set, a validation set and a test set according to a preset ratio;
[0056] An initial model acquisition unit, used to train the training set to obtain an initial domain name classification model;
[0057] A model fitting verification unit, used to verify whether the initial domain name classification model is overfitting using the verification set;
[0058] A first standard judgment unit, configured to judge whether the accuracy of the initial domain name classification model on the verification set meets a preset first standard;
[0059] A second standard judgment unit, configured to judge whether the accuracy of the initial domain name classification model on the test set meets a preset second standard;
[0060] The target model acquisition unit is configured to, if yes, use the initial domain name classification model as the target domain name classification model.
[0061] Optionally, the target model training module further includes:
[0062] A model fitting determination unit, configured to continue training the initial domain name classification model if no;
[0063] A first standard determination unit, configured to adjust the model parameters of the initial domain name classification model if no, and retrain the initial domain name classification model after the model parameters are adjusted;
[0064] The second standard determination unit is used for, if not, re-dividing the domain name classification data set to perform model training based on the re-divided domain name classification data set.
[0065] Optionally, the initial model acquisition unit is further used for:
[0066] At the input layer, converting the sample domain name and the sample domain name description information into an input text sequence in a specific form, so as to input the input text sequence into the embedding layer;
[0067] In the embedding layer, word embedding is performed on the input text sequence to obtain a word embedding result, so as to input the word embedding result into the encoding layer;
[0068] In the encoding layer, a preset bag-of-words model is used to capture local context information of the word embedding result, so that a preset linear classifier obtains an initial classification result based on the local context information, and the initial classification result is input into the output layer;
[0069] At the output layer, model parameters are estimated based on the initial classification results to obtain the initial domain name classification model.
[0070] Optionally, the label feature extraction module includes:
[0071] A tag information extraction unit, used to simulate access to the domain name to be classified by using crawler technology, and extract title information and description information of meta tags in the source code of the homepage of the domain name to be classified;
[0072] The tag feature splicing unit is used to splice the title information and the description information into the meta tag feature of the domain name to be classified as the page tag feature.
[0073] In addition, to achieve the above-mentioned purpose, the present invention also provides a domain name classification device, which includes: a memory, a processor, and a domain name classification program stored in the memory and executable on the processor, and the domain name classification program implements the steps of the above-mentioned method when executed by the processor.
[0074] In addition, to achieve the above-mentioned purpose, the present invention further provides a computer-readable storage medium, on which a domain name classification program is stored, and when the domain name classification program is executed by a processor, the steps of the above-mentioned method are implemented.
[0075] The present invention provides a domain name classification method, device and computer-readable storage medium. The domain name classification method directly extracts page tag features of the domain name to be classified as the input of the model, thereby reducing the complexity of feature engineering; by pre-defining a domain name category system with a hierarchical structure in the model, it is possible to mine the hierarchical dependency between the domain name types to which the domain name to be classified belongs, so that the hierarchical dependency can be utilized; by adding a recursive regularization method to the model, the hierarchical dependency can be integrated into the regularization structure of the model parameters; by using the hierarchical dependency and the regularized recursive structure to estimate the model parameters, the parameters of adjacent domain name types in the hierarchy are similar, which helps to use the information of similar types in the domain name hierarchy when estimating the model parameters, thereby improving the accuracy of the domain name classification method and solving the technical problem that the domain name classification accuracy of the existing domain name classification method is not high. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Figure 1 It is a schematic diagram of the structure of a domain name classification device in a hardware operating environment involved in an embodiment of the present invention;
[0077] Figure 2 This is a flowchart of a first embodiment of a domain name classification method of the present invention;
[0078] Figure 3 A schematic diagram of a crawling process of a third embodiment of a domain name classification method of the present invention;
[0079] Figure 4 A schematic diagram of a domain name classification system according to a third embodiment of a domain name classification method of the present invention;
[0080] Figure 5 This is a schematic diagram of the model training process of the third embodiment of the domain name classification method of the present invention;
[0081] Figure 6 It is a schematic diagram of the functional modules of the domain name classification device of the present invention.
[0082] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0083] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0084] like Figure 1 As shown, Figure 1 It is a schematic diagram of the domain name classification device structure of the hardware operating environment involved in the embodiment of the present invention.
[0085] like Figure 1As shown, the domain name classification device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The optional user interface 1003 may include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory). The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0086] Those skilled in the art will understand that Figure 1 The domain name classification device structure shown in the figure does not constitute a limitation on the domain name classification device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0087] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a domain name classification program.
[0088] exist Figure 1 In the domain name classification device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; and the processor 1001 can be used to call the domain name classification program stored in the memory 1005 and execute the domain name classification method provided by the embodiment of the present invention.
[0089] Based on the above hardware structure, various embodiments of the domain name classification method of the present invention are proposed.
[0090] Domain classification is the process of assigning domain names to one or more predefined categories. It plays an important role in content recommendation, network analysis of specific topics, and contextual search optimization. According to the different category labels, the domain classification problem can be divided into domain name subject classification, domain name function type classification, and other different problems. Domain name function type can be regarded as the functional label provided by the domain name to users, such as online shopping, news media, government organizations, resource downloads, and search engines. The purpose of online shopping websites is to provide users with an interface for searching products and allow users to shop and pay online.
[0091] Existing domain name classification methods based on functional types usually focus on feature engineering and rely on different types of features. They do not reveal enough about the relationships between domain name types and find it difficult to discover the relationships between different types of domain names, which leads to the technical problem of low accuracy of domain name classification.
[0092] In order to solve the above technical problems, the present invention provides a domain name classification method, that is, directly extracting the page tag features of the domain name to be classified as the input of the model, thereby reducing the complexity of feature engineering; by pre-defining a domain name category system with a hierarchical structure in the model, it is possible to mine the hierarchical dependency between the domain name types to which the domain name to be classified belongs based on this, so that this hierarchical dependency can be utilized; by adding a recursive regularization method in the model, the hierarchical dependency can be integrated into the regularization structure of the model parameters; by using the hierarchical dependency and the regularized recursive structure to estimate the model parameters, the parameters of adjacent domain name types in the hierarchy are similar, which is helpful to use the information of similar types in the domain name hierarchy when estimating the model parameters, thereby improving the accuracy of the domain name classification method, and solving the technical problem that the domain name classification accuracy of the existing domain name classification method is not high.
[0093] Reference Figure 2 , Figure 2 This is a flowchart of the first embodiment of the domain name classification method.
[0094] A first embodiment of the present invention provides a domain name classification method, the domain name classification method comprising:
[0095] Step S10, obtaining a domain name to be classified, and extracting page tag features of the domain name to be classified;
[0096] Step S20, inputting the page tag features into a pre-trained target domain name classification model with a recursive regularization function, wherein a domain name category system with a hierarchical structure has been defined in the target domain name classification model;
[0097] In this embodiment, the method is applied to a terminal device. When the terminal obtains one or more domain names to be classified, it extracts features from the page tags of the domain names to be classified, and uses the extracted page tag features as input of the pre-training model.
[0098] The domain name to be classified refers to the domain name that needs to be classified in this domain name classification task, which can be one or more.
[0099] Page tag features refer to the tag features in the HTML page where the domain name to be classified is located, such as meta tag features.
[0100] The target domain name classification model refers to a pre-trained model for domain name classification, which can be used to perform functional classification of domain names or thematic classification of domain names.
[0101] The domain name classification system refers to a predefined hierarchical system of functional types or subject types for domain names. The following uses functional types as an example, and the hierarchy is determined by the functional type of the domain name itself and domain experts. A domain name can have one or more functional types, that is, one or more functional labels. Therefore, multi-label classification methods are more suitable for capturing the functional types of domain names. According to the above properties of the domain name functional type classification problem, it can be mapped to the machine learning task of hierarchical multi-label classification, where domain names can belong to multiple functional types and there is a hierarchy between types.
[0102] Step S30, based on the target domain name classification model, analyzing the hierarchical dependency relationship between a plurality of domain name types related to the page tag feature and corresponding to the domain name classification system;
[0103] Step S40, using the hierarchical dependency relationship in combination with the regularized recursive structure to estimate model parameters, so as to obtain a target classification label of the domain name to be classified based on the domain name classification model after the model parameter estimation.
[0104] In this embodiment, the target classification label refers to the specific classification label of the domain name to be classified that is finally output by the model. Each domain name to be classified may correspond to one target classification label or multiple target classification labels.
[0105] The target domain name classification model uses a convex loss function to hierarchically classify multiple domain name types, and obtains the hierarchical dependency relationship of multiple domain name types to which the domain name to be classified belongs in the domain name category system. Then, based on the preset recursive regularization method, the hierarchical dependency relationship is integrated into the regularization structure of the model parameters. Finally, based on the preset formula, the model parameters are estimated in combination with the convex loss function, adjustment parameters and regularization structure to obtain the final target classification label and output it.
[0106] In this embodiment, by acquiring a domain name to be classified, a page label feature of the domain name to be classified is extracted; the page label feature is input into a pre-trained target domain name classification model with a recursive regularization function, wherein a domain name category system with a hierarchical structure has been defined in the target domain name classification model; based on the target domain name classification model, a hierarchical dependency relationship between several domain name types related to the page label feature and corresponding to the domain name category system is analyzed; model parameters are estimated by using the hierarchical dependency relationship and combining with the regularized recursive structure, so as to obtain a target classification label of the domain name to be classified based on the domain name classification model after the model parameter estimation. Through the above-mentioned manner, the present invention directly extracts the page tag features of the domain name to be classified as the input of the model, thereby reducing the complexity of feature engineering; by pre-defining a domain name category system with a hierarchical structure in the model, it is possible to mine the hierarchical dependency between the domain name types to which the domain name to be classified belongs based on this, so that this hierarchical dependency can be utilized; by adding a recursive regularization method in the model, the hierarchical dependency can be integrated into the regularization structure of the model parameters; by using the hierarchical dependency and the regularized recursive structure to estimate the model parameters, the parameters of adjacent domain name types in the hierarchy are similar, which helps to use the information of similar types in the domain name hierarchy when estimating the model parameters, thereby improving the accuracy of the domain name classification method, and solving the technical problem that the domain name classification accuracy of the existing domain name classification method is not high.
[0107] Furthermore, based on the above Figure 2 The first embodiment shown in the figure provides a second embodiment of the domain name classification method of the present invention. In this embodiment, step S30 includes:
[0108] The convex loss function in the target domain name classification model is used to hierarchically classify the domain name types to obtain the hierarchical dependency relationship.
[0109] In this embodiment, the model uses BCEWithLogitsLoss or other types of convex loss functions to hierarchically classify multiple domain name function types (domain name function labels) to which the classified domain name belongs, and determines the hierarchical dependency relationship between the multiple domain name function types based on a predefined domain name function category system.
[0110] Furthermore, the step of estimating model parameters by utilizing the hierarchical dependency relationship in combination with a regularized recursive structure includes:
[0111] Based on the recursive regularization method in the target domain classification model, the hierarchical dependency relationship is integrated into the regularization structure of the model parameters;
[0112] Model parameter estimation is performed based on the convex loss function, adjustment parameters and the regularization structure in the target domain name classification model.
[0113] In this embodiment, the prediction function is formalized as a set of parameters:
[0114] W = {w n ,n∈N},
[0115] where each domain feature type n in the hierarchy is associated with a parameter vector w n The predicted feature type label is parameterized by a set of parameters w, which are then estimated during the learning process:
[0116]
[0117] Among them, R emp represents the empirical risk or loss of the domain function type on the training dataset, λ(w) represents the regularization term, and C is a parameter that adjusts the complexity of fitting training instances to the hierarchical multi-label classification model (i.e., the adjustment parameter mentioned above).
[0118] Empirical risk R emp The penalty caused by defining instances that are not at the leaves of the hierarchy:
[0119]
[0120] Where L can be any convex loss function, such as BCEWithLogitsLoss function, and w n is the parameter vector corresponding to the domain function type n, M represents the training sample set, y in is the true label of sample i, x i represents the predicted label of sample i.
[0121] The expression that incorporates the recursive structure into the regularization term is:
[0122]
[0123] This recursive form of regularization takes into account the hierarchical dependencies of domain function types, making the parameters of adjacent domain function types in the hierarchy similar, which helps to exploit the information of similar functional types in the domain hierarchy when estimating model parameters.
[0124] Further, step S10 includes:
[0125] Using crawler technology to simulate access to the domain name to be classified, extracting title information and description information of meta tags in the source code of the homepage of the domain name to be classified;
[0126] The title information and the description information are combined into a meta tag feature of the domain name to be classified to serve as the page tag feature.
[0127] In this embodiment, for the domain name to be classified, the terminal uses crawler technology to simulate access to the domain name to be classified, extracts the title and description information (that is, the above-mentioned title information and description information) of the meta tag in the source code of the homepage of the domain name to be classified, and splices them into the meta tag features of the domain name to be classified. Among them, the meta tag is an important html tag in the source code of the HTML web page. The meta tag is used to describe the properties of an HTML web page document, such as author, date and time, web page description, keywords, page refresh, etc.
[0128] This embodiment further adds a recursive regularization method to the model so that the hierarchical dependency can be integrated into the regularization structure of the model parameters; by using the hierarchical dependency and the regularized recursive structure to estimate the model parameters, the parameters of adjacent domain name types in the hierarchy are made similar, which helps to use information of similar types in the domain name hierarchy when estimating the model parameters, thereby improving the accuracy of the domain name classification method; by only using features extracted from meta tags as the input of the model, the complexity of feature engineering is reduced.
[0129] Furthermore, based on the above Figure 2 The first embodiment shown in the figure proposes a third embodiment of the domain name classification method of the present invention. In this embodiment, before step S10, it also includes:
[0130] Crawl a domain name paging list in a specified website, traverse each domain name paging in the domain name paging list to obtain a sample domain name address, a sample domain name type and a sample domain name description information as domain name sample information;
[0131] According to the sample domain name addresses and the sample domain name types, the domain name types are divided into two levels: major categories and subcategories, so as to define the domain name classification system;
[0132] The domain name sample information is constructed into a domain name classification data set according to the domain name category system, and the domain name classification data set is trained based on a neural network model architecture to obtain the target domain name classification model, wherein the target domain name classification model includes an input layer, an embedding layer, an encoding layer and an output layer.
[0133] In this embodiment, the designated website may specifically be the Chinese website rankings of Aizhan.com and the website rankings of webmasters' home, etc. Among them, the Aizhan.com rankings collect well-known websites ranked in various industries in China, and are ranked according to Baidu's popularity, Alexa, etc. The Chinese website rankings are the most professional and authoritative Chinese website rankings in China; the website rankings of webmasters' home is a column under webmasters' home that professionally provides Chinese website ranking services, and collects many well-known websites ranked at the top of various industries in China. It is a professional and leading Chinese website ranking in China.
[0134] Specifically, the terminal uses web crawler technology to crawl the domain name page list in the Chinese website ranking list of Aizhan.com and the website ranking list of the webmaster home, and then traverses each domain name page to obtain the specific domain name, domain name type, and domain name description information. The crawling process is as follows: Figure 3 The terminal simulates accessing the paginated page of the ranking list, and then simulates accessing and parsing the domain name information of a specific page according to the source code of the ranking list pagination, and finally extracts the domain name address, domain name type, domain name title and description information of the specific domain name as the domain name sample information.
[0135] The domain name category system can specifically refer to the domain name function category system. The domain name function type refers to the domain name function and purpose provided to Internet users by the domain name. Its hierarchical structure is determined by the domain name's own function type and domain experts. According to the crawled domain name address and domain name type, the domain name function category system can be divided into two levels: major categories and subcategories. Specifically, there are 10 major categories and 109 subcategories. The 10 major categories and some subcategories and their hierarchical relationships are as follows: Figure 4 As shown. The 10 major categories include: leisure and entertainment, life services, online shopping, network technology, sports and fitness, travel and tourism, news media, government organizations, education and culture, and medical health. The leisure and entertainment category may include subcategories such as video movies and game websites, the life services category may include subcategories such as catering and job recruitment, the online shopping category may include subcategories such as rebates and discounts, online shopping malls, the network technology category may include subcategories such as mobile phones and cloud disk albums, the sports and fitness category may include subcategories such as sports indicators and outdoor leisure, the travel category may include subcategories such as travel e-commerce and travel guides, the news media category may include subcategories such as news portals and radio and television, the government organization category may include subcategories such as government portals and public institutions, the education and culture category may include subcategories such as online education and school websites, and the medical health category may include subcategories such as cosmetic surgery and hospitals and clinics.
[0136] Finally, the terminal constructs the domain name sample information into a domain name-level multi-label classification dataset based on the domain name category system, and trains the domain name-level multi-label classification dataset based on the neural network model architecture to obtain a target domain name classification model including an input layer, an embedding layer, an encoding layer, and an output layer.
[0137] This embodiment further divides the domain name types into hierarchical structures and establishes a system, which helps to standardize domain name types and analyze the relationship between different domain name types.
[0138] Furthermore, the step of training the domain name classification data set based on the neural network model architecture to obtain the target domain name classification model includes:
[0139] The domain name classification data set is randomly divided into a training set, a validation set and a test set according to a preset ratio;
[0140] Training the training set to obtain an initial domain name classification model;
[0141] Using the validation set to verify whether the initial domain name classification model is overfitting;
[0142] If yes, determining whether the accuracy of the initial domain name classification model on the validation set meets a preset first standard;
[0143] If yes, determining whether the accuracy of the initial domain name classification model on the test set meets a preset second standard;
[0144] If so, the initial domain name classification model is used as the target domain name classification model.
[0145] Furthermore, after the step of using the verification set to verify whether the initial domain name classification model is overfitting, the method further includes:
[0146] If not, continue training the initial domain name classification model;
[0147] After the step of determining whether the accuracy of the initial domain name classification model on the validation set meets the preset first standard, the method further includes:
[0148] If not, adjusting the model parameters of the initial domain name classification model, and retraining the initial domain name classification model after the model parameters are adjusted;
[0149] After the step of determining whether the accuracy of the initial domain name classification model on the test set meets the preset second standard, the method further includes:
[0150] If not, the domain name classification data set is re-divided to perform model training based on the re-divided domain name classification data set.
[0151] In this embodiment, the preset ratio can be flexibly set according to actual conditions, and this embodiment does not make specific limitations. The preset first standard can be set to exceed the preset first threshold, and the preset second standard can be set to exceed the preset second threshold, wherein the first threshold and the second threshold can be set to be the same or different, depending on the specific situation.
[0152] As a specific embodiment, Figure 5As shown. The terminal randomly divides the domain name function type hierarchical multi-label classification data set into training set, validation set and test set according to a certain ratio, and then starts a round of training for the training set to obtain the initial domain name function type hierarchical multi-label classification model (that is, the above-mentioned initial target domain name classification model). The terminal uses the validation set to verify whether the model is overfitting. If the model is not overfitting, the model continues to be trained; if the model is overfitting, it continues to determine whether it is satisfied with the accuracy of the model on the validation set. If it is not satisfied with its accuracy on the validation set, the model parameters are adjusted to retrain the model; if it is satisfied with its accuracy on the validation set, it continues to determine whether it is satisfied with the accuracy of the model on the test set. If it is not satisfied with its accuracy on the test set, the domain name function type hierarchical multi-label data set is analyzed and re-divided into new training set, validation set and test set; if it is satisfied with its accuracy on the test set, it means that the model has been successfully trained at this time.
[0153] Furthermore, the step of training the training set to obtain an initial domain name classification model includes:
[0154] At the input layer, converting the sample domain name and the sample domain name description information into an input text sequence in a specific form, so as to input the input text sequence into the embedding layer;
[0155] In the embedding layer, word embedding is performed on the input text sequence to obtain a word embedding result, so as to input the word embedding result into the encoding layer;
[0156] In the encoding layer, a preset bag-of-words model is used to capture local context information of the word embedding result, so that a preset linear classifier obtains an initial classification result based on the local context information, and the initial classification result is input into the output layer;
[0157] At the output layer, model parameters are estimated based on the initial classification results to obtain the initial domain name classification model.
[0158] In this embodiment, at the input layer, the title and description information in the data set are extracted as domain name meta information, which is processed as an input text sequence and represented as word tags and their N-gram models n-gram form.
[0159] In the embedding layer, the supervised word embedding method of regional embedding is used to embed words for the input data of the input layer. The representation of the word after embedding includes the embedding of the word itself and the weighted matrix that interacts with the local context. The word features and the contextual information after regional embedding are used as the input of the encoding layer.
[0160] At the encoding layer, the bag-of-words model is used as an additional feature to capture the local contextual information of the word, which is then fed into a linear classifier. The text representation is a hidden variable that can be potentially reused, where the intermediate words are replaced by labels.
[0161] In the output layer, a convex loss function such as BCEWithLogitsLoss is used for hierarchical classification and a recursive regularization method is added to integrate the hierarchical dependency between domain name function labels into the regularization structure of the parameters. Based on this, the prediction accuracy is improved and the domain name type classification result is finally accurately output.
[0162] like Figure 6 As shown, the present invention also provides a domain name classification device, the domain name classification device comprising:
[0163] The tag feature extraction module 10 is used to obtain the domain name to be classified and extract the page tag features of the domain name to be classified;
[0164] The tag feature input module 20 is used to input the page tag feature into a pre-trained target domain name classification model with a recursive regularization function, wherein a domain name category system with a hierarchical structure has been defined in the target domain name classification model;
[0165] A hierarchical relationship analysis module 30, for analyzing the hierarchical dependency relationship between a plurality of domain name types related to the page tag feature and corresponding to the domain name classification system based on the target domain name classification model;
[0166] The target label acquisition module 40 is used to estimate model parameters by using the hierarchical dependency relationship in combination with the regularized recursive structure, so as to obtain the target classification label of the domain name to be classified based on the domain name classification model after the model parameter estimation.
[0167] The invention also provides a domain name classification device.
[0168] The domain name classification device includes: a processor, a memory, and a domain name classification program stored in the memory and executable on the processor, wherein when the domain name classification program is executed by the processor, the steps of the domain name classification method described above are implemented.
[0169] The method implemented when the domain name classification program is executed can refer to the various embodiments of the domain name classification method of the present invention, and will not be described in detail here.
[0170] The present invention also provides a computer-readable storage medium.
[0171] The computer-readable storage medium of the present invention stores a domain name classification program, and when the domain name classification program is executed by a processor, the steps of the domain name classification method described above are implemented.
[0172] The method implemented when the domain name classification program is executed can refer to the various embodiments of the domain name classification method of the present invention, and will not be repeated here.
[0173] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0174] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0175] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a domain name classification device to execute the methods described in each embodiment of the present invention.
[0176] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A domain name classification method, characterized in that: The domain name classification method comprises: Crawl a domain name paging list in a specified website, traverse each domain name paging in the domain name paging list to obtain a sample domain name address, a sample domain name type and a sample domain name description information as domain name sample information; According to the sample domain name addresses and the sample domain name types, the domain name types are divided into two levels: major categories and subcategories, so as to define a domain name classification system; The domain name sample information is constructed into a domain name classification data set according to the domain name category system, and the domain name classification data set is trained based on a neural network model architecture to obtain a target domain name classification model; Obtaining a domain name to be classified, and extracting page tag features of the domain name to be classified; Inputting the page tag features into a pre-trained target domain name classification model with a recursive regularization function, wherein a domain name category system with a hierarchical structure has been defined in the target domain name classification model; Using the convex loss function in the target domain name classification model, hierarchically classify a plurality of domain name function types related to the page tag features on the domain name category system to obtain a hierarchical dependency relationship between the plurality of domain name function types; Based on the recursive regularization method in the target domain name classification model, the hierarchical dependency relationship is integrated into the regularization structure of the model parameters, and the model parameters are estimated based on the convex loss function, adjustment parameters and the regularization structure in the target domain name classification model, so as to obtain the target classification label of the domain name to be classified based on the domain name classification model after the model parameter estimation; The estimating model parameters based on the convex loss function, adjustment parameters and the regularization structure in the target domain name classification model includes: The model parameters are estimated using the following formula: in, represents the estimated model parameters, R emp represents the empirical risk or loss of the domain function type on the domain classification dataset, λ(w) represents the regularization term, C is the parameter that adjusts the complexity of fitting training instances and hierarchical multi-label classification models, that is, the adjustment parameter, L is the convex loss function, w n is the parameter vector corresponding to the domain function type n, M represents the training sample set, that is, the domain classification dataset, y in is the true label of sample i, x i represents the predicted label of sample i.
2. The domain name classification method according to claim 1, characterized in that: The target domain name classification model includes an input layer, an embedding layer, an encoding layer and an output layer.
3. The domain name classification method according to claim 2, characterized in that: The step of training the domain name classification data set based on the neural network model architecture to obtain the target domain name classification model includes: The domain name classification data set is randomly divided into a training set, a validation set and a test set according to a preset ratio; Training the training set to obtain an initial domain name classification model; Using the validation set to verify whether the initial domain name classification model is overfitting; If yes, determining whether the accuracy of the initial domain name classification model on the validation set meets a preset first standard; If yes, determining whether the accuracy of the initial domain name classification model on the test set meets a preset second standard; If so, the initial domain name classification model is used as the target domain name classification model.
4. The domain name classification method according to claim 3, characterized in that: After the step of using the verification set to verify whether the initial domain name classification model is overfitting, the method further includes: If not, continue training the initial domain name classification model; After the step of determining whether the accuracy of the initial domain name classification model on the validation set meets the preset first standard, the method further includes: If not, adjusting the model parameters of the initial domain name classification model, and retraining the initial domain name classification model after the model parameters are adjusted; After the step of determining whether the accuracy of the initial domain name classification model on the test set meets the preset second standard, the method further includes: If not, the domain name classification data set is re-divided to perform model training based on the re-divided domain name classification data set.
5. The domain name classification method according to claim 4, characterized in that: The step of training the training set to obtain an initial domain name classification model comprises: At the input layer, converting the sample domain name and the sample domain name description information into an input text sequence in a specific form, so as to input the input text sequence into the embedding layer; In the embedding layer, word embedding is performed on the input text sequence to obtain a word embedding result, so as to input the word embedding result into the encoding layer; In the encoding layer, a preset bag-of-words model is used to capture local context information of the word embedding result, so that a preset linear classifier obtains an initial classification result based on the local context information, and the initial classification result is input into the output layer; At the output layer, model parameters are estimated based on the initial classification results to obtain the initial domain name classification model.
6. The domain name classification method according to any one of claims 1 to 5, characterized in that: The step of obtaining the domain name to be classified and extracting the page tag features of the domain name to be classified includes: Using crawler technology to simulate access to the domain name to be classified, extracting title information and description information of meta tags in the source code of the homepage of the domain name to be classified; The title information and the description information are combined into a meta tag feature of the domain name to be classified to serve as the page tag feature.
7. A domain name classification device, characterized in that: The domain name classification device includes: a memory, a processor, and a domain name classification program stored in the memory and executable on the processor. When the domain name classification program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a domain name classification program, and when the domain name classification program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
A method and apparatus for calibrate IP address service attributes
CN109388710A
