A web service classification method fusing unstructured and structured information

By combining LDA, Doc2Vec, and Node2Vec models and integrating unstructured and structured information, a multilayer perceptron model was designed to solve the problem of ignoring network structure information in Web service classification, thus achieving more efficient Web service classification.

CN113111288BActive Publication Date: 2026-07-21HUNAN UNIV OF SCI & TECH
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUNAN UNIV OF SCI & TECH
Filing Date
2021-04-09
Publication Date
2026-07-21

Smart Images

  • Figure CN113111288B_ABST
    Figure CN113111288B_ABST
Patent Text Reader

Abstract

The application provides a Web service classification method fusing unstructured and structured information. First, two document representation methods are used to convert each service document into a feature vector, namely a topic distribution based on a latent Dirichlet allocation (LDA) and a document embedding model Doc2Vec based on a neural network, to increase the diversity of classification features. Then, a recently proposed network embedding technology, Node2Vec, is applied to obtain a structural representation vector from two relationship graphs, namely a service call graph and a service label graph. Finally, a classifier is trained through a combined embedding connected by the above multi-dimensional feature vectors. Comprehensive experiments on actual data sets prove the effectiveness of the method and the performance of Web service classification can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention mainly relates to the technical field of Web service classification, specifically a Web service classification method that integrates unstructured and structured information. Background Technology

[0002] Web services have become the mainstream implementation technology for SOA (Service-Oriented Architecture) due to their cross-language, cross-platform, loosely coupled, and open standards. With the development of Web 2.0 technologies, web services and their components (such as mashups) have grown rapidly on the Internet over the past decade. The increase in the number of web services has significantly increased the burden on people to efficiently use and manage service repositories. In the past, web service classification has proven to be an effective technique to alleviate this challenge. As an important tool for exploratory data analysis, web service classification is essential for capturing and understanding the hierarchical functional structure of services in closed repositories such as the programmable web. It greatly facilitates a wide range of downstream tasks, such as service discovery and selection, service composition, and service recommendation.

[0003] To date, much work has been done on service classification. However, most of these efforts focus on mining unstructured information using document representation methods such as probabilistic topic models (e.g., PLSA and LDA) and neural network-based document embeddings (e.g., Doc2Vec). They typically begin by learning latent topic or functional unstructured vectors to represent service documents. Then, an appropriate classifier is trained based on the affinity relationships between these vectors. It's worth noting that while topic models can transform a high-dimensional document word vector space into a low-dimensional unstructured vector space, they are all bag-of-words models. Their fundamental characteristic is ignoring word order information in the text, i.e., they don't consider the word order within paragraphs, only representing independent concepts in a few dimensions. Therefore, topic models cannot extract information from the word order in the original text. While Doc2Vec has word order semantic analysis capabilities, it struggles to obtain implicit functional semantic features. Based on these observations, we believe that combining the two types of document representation models mentioned above may help obtain more comprehensive document embeddings. Furthermore, some investigations attempt to incorporate auxiliary information, such as labels and prior knowledge, into the representation process. These methods often utilize service content or service connection structures as general genes to mitigate the impact of data sparsity problems. For example, labels can be introduced to improve the LDA training process. However, since labels are created by different service developers, this can introduce lexical gap problems (e.g., two different words expressing similar meanings), leading to semantic inconsistencies between functionally equivalent services. A major problem with all the methods mentioned above is that they are based only on simple and static service context information, which can lead to suboptimal performance because unstructured service descriptions are often short, sparse, and full of noisy features.

[0004] Services are created not only to operate independently but also to collaborate with others to accomplish complex tasks—that is, to combine services with different functions to form value-added applications. Frequent interconnections between services (i.e., composition or label-sharing relationships) form a complex network of relationships, revealing structured correlations between services. In fact, these behaviors are akin to folklore, and can be viewed as a process of manually classifying web services. For example, labeling a service means classifying it into a corresponding functional category based on user interpretation; services with similar labels may belong to the same category. Similarly, composition behavior means that users attempt to aggregate multiple complementary services from different categories. We believe that these relevant features from network relationships can be used to enhance the unstructured web service classification process. For example, in the Program Integration Web dataset, there are two mashups (“Backup Box” and “Crisply”) belonging to the Tools category. Their labels and functional descriptions are dissimilar, making it difficult to classify them into the same category. However, both structurally call the same API, Google Drive. Similarly, in API classification scenarios, there are situations where the true category of an API cannot be effectively identified using only unstructured features. Therefore, we believe that it is very important to learn a unified service feature representation by combining both unstructured and structured service relationships, which is crucial for exploring the optimal service classification performance.

[0005] Network representation learning (NRL) is a recently proposed key method for addressing sparsity problems by learning continuous, low-dimensional potential features of network nodes. These features encompass the global structure of the network and can be extracted for subsequent machine learning tasks. Deep walk algorithms are among the most classic methods in NRL. They typically begin by obtaining a sequence of nodes through short random walks, then input these sequences into a skip graph model to obtain the final embedding vectors. Intuitively, adjacent nodes often share similar contexts (sequences) and therefore have similar embeddings. Based on this, many deep walk-based methods have been developed, such as GraRep, LINE, and Node2Vec. The emergence of these NRL methods makes it possible to fuse structured information with functional unstructured information. Summary of the Invention

[0006] To address the shortcomings of current technologies, this invention, based on existing technologies and practical applications, provides a Web service classification method that integrates unstructured and structured information, which can effectively improve the performance of Web service classification.

[0007] To achieve the above objectives, the technical solution of the present invention is as follows:

[0008] A Web service classification method that integrates unstructured and structured information is characterized by the following steps: (1) Unstructured feature extraction: From the perspective of unstructured information, the Web service is embedded unstructuredly based on a combination of LDA and Doc2Vec document representation methods. The unstructured embedding not only considers the descriptive information of the service document, but also integrates other auxiliary information such as tags; (2) Structured feature extraction: From the perspective of service network structure, the service call network and service tag network are constructed respectively using the structural relationship information of the dataset. The service network relationship features are preserved by a set of low-dimensional vectors based on the network embedding technology - Node2Vec; (3) Multilayer perceptron model: A multilayer perceptron model that benefits from the feature embedding vectors of LDA and Doc2Vec and is used to learn and enhance the Web service classifier is designed. By connecting all the representation vectors as input, the multilayer perceptron is trained to classify Web services.

[0009] Furthermore, in step (1), a preprocessing process is performed on the Web service description document before the Web service is embedded in unstructured form. The preprocessing process includes the following steps:

[0010] (1) Use the pandas natural language processing toolkit in Python to extract relevant information about the Web API from the selected Web services;

[0011] (2) Use the NLTK natural language toolkit in Python to segment words according to spaces and separate punctuation marks from words;

[0012] (3) Use the stop word list in the NLTK Natural Language Toolkit in Python to remove stop words;

[0013] (4) Stemonize words that are different in form but the same in substance;

[0014] (5) Extract the words that appear in the processed Web service description document and perform dictionary processing;

[0015] (6) Represent each word in the processed Web service description document and dictionary as a One-Hot vector, and then construct a feature matrix from the One-Hot vectors.

[0016] Furthermore, in step (1), after obtaining the preprocessed unstructured information, it is used as the input to the topic model LDA and the document embedding model Doc2Vec, respectively, to convert the text into a vector representation, thereby obtaining the combined unstructured embedding.

[0017] Furthermore, in step (2), before obtaining the structured embedding, a Web service relationship network generation component is used to extract structured features from the structured information; the Web service relationship network is defined in two forms: (1) Service call network: in this network, network nodes can be Mashups or APIs, and if two Mashups call the same API or two APIs are called by the same Mashup, then there is an edge between the two nodes; (2) Service tag network: in this network, network nodes can also be Mashups or APIs, and if two Mashups or APIs contain the same tag, then there is an edge between the two nodes. The output of the relationship network generation component is a Mashup-API call undirected adjacency matrix and a tag undirected adjacency matrix.

[0018] Furthermore, structured embeddings are obtained through the Node2Vec model. By inputting the undirected adjacency matrix called by the Mashup-API and the undirected adjacency matrix labeled by the Mashup-API into the Node2Vec model, we ultimately obtain structured feature vectors. The Node2Vec model is executed sequentially in three stages: preprocessing to calculate transition probabilities, random walk simulation, and optimization using SGD; each stage is parallelizable and executed asynchronously.

[0019] Furthermore, in step (3), a connection layer is designed to fuse the two types of unstructured embeddings and two types of structured relational embeddings. Then, the cascaded multidimensional feature vectors are used as input to the MLP model, and the true category corresponding to each service is used as output. The output layer is normalized using the Softmax function. Finally, a Web service classifier is obtained by training the MLP model.

[0020] The beneficial effects of this invention are:

[0021] In this invention, we learn a Web service classifier that combines multi-dimensional features by training embedded vectors containing unstructured functional information and structured network relationships. Simultaneously, we apply two different document embedding methods to obtain a more comprehensive unstructured representation and add auxiliary information to enhance this representation. We also emphasize for the first time the importance of developing diverse service relationship networks and focus on mining cooperation information between APIs to pursue suitable API combinations. Finally, extensive and comprehensive experiments were conducted on very real datasets. The experimental results show that, compared with other state-of-the-art models, our method significantly improves cross-entropy loss, Ma-F1, and Mi-F1 metrics compared to traditional Web service classification methods. Attached Figure Description

[0022] Figure 1This is a general model framework diagram of the Web service classification method of the present invention;

[0023] Figure 2 This is a diagram of the LDA model structure.

[0024] Figure 3 The model structure diagrams for Word2Vec and Doc2Vec are shown below.

[0025] Figure 4 Example graphs of breadth-first search and depth-first search in a service relationship network;

[0026] Figure 5 Example diagram of random walk strategy in Node2Vec model;

[0027] Figure 6 A comparison chart of hyperparameter experiments on the Mashup dataset;

[0028] Figure 7 This is a comparison chart of hyperparameter experiments for the API dataset. Detailed Implementation

[0029] The present invention will be further described in conjunction with the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined in this application.

[0030] Existing Web service classification techniques primarily focus on functional information such as description text and tags, neglecting the implicit network structure information between words and the text itself. Therefore, this invention proposes a novel Web Service Classification Method (LDN) that aims to improve classification accuracy by combining multidimensional features. First, we learn a combined service unstructured embedding based on two document representation methods: LDA and Doc2Vec. The unstructured embedding integrates descriptive information and other auxiliary information (such as popularity, tags, etc.). Second, we propose preserving service network relationships through a set of low-dimensional vectors based on the recently proposed network embedding technique Node2Vec. Finally, we design a multilayer perceptron for learning an enhanced Web service classifier that benefits from feature embedding vectors from both of the above aspects.

[0031] The overall framework of the Web service classification method proposed in this invention is as follows: Figure 1As shown, the model comprises three parts: 1) Unstructured feature extraction, learning unstructured representations of services from description documents; 2) Structured feature extraction, capturing structured representations from service relationship networks; and 3) A multilayer perceptron model, training a multilayer perceptron to classify web services by concatenating all representation vectors as input. In the web service description document preprocessing, web service description text and other relevant information are first crawled and stored from the ProgrammableWeb website, and corresponding feature columns are extracted to construct a feature vector matrix. During model building and training, unstructured information (e.g., API and Mashup tags and feature descriptions in the service repository) is first preprocessed by a preprocessing component. Document preprocessing typically involves three steps: normalization, stemming, and stop word removal. The preprocessed unstructured information matrix serves as input to the LDA and Doc2Vec models, converting the text into vector representations. Next, we utilize a relationship network generation component to extract structured features from the structured information. The Web service relationship network of this invention can be defined in two forms: (1) Service call network: In this network, network nodes can be Mashups or APIs. If two Mashups call the same API or two APIs are called by the same Mashup, then there is an edge between the two nodes; (2) Service tag network: In this network, network nodes can also be Mashups or APIs. If two Mashups or APIs contain the same tag, then there is an edge between the two nodes. The output of the relationship network generation component is the undirected adjacency matrix of Mashup-API calls and the undirected adjacency matrix of Mashup-API tags, which are the inputs of the Node2Vec model. In the process of fusing multidimensional features, we design a connection layer to fuse the above two functional unstructured embeddings and two structured relationship embeddings. Then, the concatenated multidimensional feature vectors are used as the input of the MLP model, and the true category corresponding to each service is used as the output. Finally, a Web service classifier is obtained by training the MLP model.

[0032] The following provides a detailed description of the Web service description document preprocessing, model construction, and training of this invention.

[0033] Web service description document preprocessing:

[0034] Web service description documents describe the core functionality of a web service and are the primary source of information for classifying web services. Because some entries in these documents contain a large amount of useless information, preprocessing is necessary. The preprocessing process includes the following steps:

[0035] 1. Web service description document information extraction: The pandas natural language processing toolkit in Python is used to extract the five columns of Web API (“APIName”, “tags”, “desc”, “primary_category”, “sub_primary”) from the selected Web service.

[0036] 2. Web service description document tokenization: Using Python's NLTK (Natural Language Toolkit) to segment words by spaces and separate punctuation marks from words.

[0037] 3. Filtering Stop Words: There are many invalid words and punctuation marks in English, such as "a", "to", ", etc. These words or symbols without actual meaning are called stop words. Use the stop word list in NLTK to remove stop words.

[0038] 4. Stemming: In English, the same word can have different forms depending on tense, person, etc. For example, "introduce", "introducing", "introduces", etc., but they are all actually the same word "introduce". If these words are treated as different words, the accuracy of similarity calculation will be reduced. Therefore, it is necessary to perform stemming.

[0039] 5. Extract words from the processed Web service description document and perform dictionary processing.

[0040] 6. Every word in the processed Web service description document and dictionary will be used as input for model building and training.

[0041] Model building and training:

[0042] Our model's overall process consists of three main components: 1) unstructured feature extraction, learning unstructured representations of services from description documents; 2) structured feature extraction, capturing structured representations from the service relationship network; and 3) a multilayer perceptron model, training a multilayer perceptron to classify Web services by concatenating all representation vectors as input.

[0043] I. Unstructured Feature Extraction

[0044] Unstructured feature extraction consists of two document representation models: LDA and Doc2Vec. We will now describe the details of each model separately.

[0045] 1.1 Potential Dirichlet Allocation (LDA)

[0046] The primary objective of LDA (Learning Derivatives) is to identify latent topics or themes that penetrate a given corpus based on word frequencies in each document, assuming that individual documents are generated by a predefined probabilistic process. Therefore, it can be considered an unsupervised generative topic model. LDA assumes that documents have characteristics of topic distribution, while topics have characteristics of word distribution. Thus, it assumes that each document is generated by a predefined probabilistic process. Figure 2 The process shown in the diagram generates documents that use a specified corpus to estimate the topic probability distribution θ and the word probability distribution φ for each topic in each document. The LDA document generation process is as follows: First, each topic φ is sampled from the Dirichlet distribution using the hyperparameter β. k Word distribution.

[0047]

[0048] Secondly, the topic distribution θ of the documents is sampled from the Dirichlet distribution using the hyperparameter α, expressed by formula (2):

[0049]

[0050] Latent variable z n That is, the topic assignment for each word follows a multinomial distribution of parameter θ, expressed by formula (3):

[0051]

[0052] φ k In formula (4), it follows the Dirichlet distribution with parameter β.

[0053]

[0054] Finally, also from having z n w is obtained from the multinomial distribution of β. n It can be expressed by formula (5):

[0055]

[0056] Given α and β, we first form a joint distribution with θ, z, and d, resulting in distribution d, which is represented by equation (6):

[0057]

[0058] The posterior probability in formula (6) of the latent variables can be obtained through variational expectation maximization or folded Gibbs sampling. If the features of a document, i.e., the proportion of K topics in the document, are extracted from the relationship between the document and words according to the LDA formula, then LDA can produce higher document classification performance than other document representation methods (such as TF-IDF).

[0059] 1.2 Doc2Vec Model

[0060] One-hot encoding is the simplest method to convert words into fixed-size numeric vectors, but it has two main drawbacks. First, one-hot encoding requires a large amount of memory because the dimension of the word vector in one-hot encoding is equal to the number of unique words in the corpus, typically exceeding hundreds of thousands. Second, one-hot encoding cannot preserve unstructured relationships between two words because the internal product of any given two words is zero, meaning all words are independent. To overcome these limitations, Mikolov et al. proposed a neural network-based word representation method called Word2Vec. Figure 3 (a)). Given a set of training words w1, w2, ..., w T The goal of Word2Vec is to maximize the predicted log probability.

[0061]

[0062] Where k is the window size for storing context information. Prediction is typically performed using multi-class classification with the Softmax function, as shown below:

[0063]

[0064] Each y i It is the i-th output value of the feedforward neural network calculated using the following method:

[0065] y = b + Uh(w t-k , ..., w t+k ;W) (9)

[0066] Where b, U, h, and W are the bias term between the hidden layer and the output layer, the weight matrix between the hidden layer and the output layer, the average or concatenated context words, and the word embedding matrix, respectively.

[0067] Doc2Vec is an extension of Woc2Vec that attempts to determine a sufficiently continuous vector for a paragraph or even a larger document to represent unstructured relationships between documents. The goal of Doc2Vec is to create vectorized representations of documents, regardless of their length. Similar to Woc2Vec, each word is represented by a d-dimensional continuous vector (d << |V|, which is the size of the vocabulary in the corpus). Furthermore, the document itself is also represented by continuous vectors in the same space as the Word vectors, such as... Figure 3 As shown in (b). In Doc2Vec, each document is mapped to a unique vector represented by the columns of matrix D, and each word is mapped to a unique vector represented by the columns of matrix W. Therefore, the only change in the network form is the addition of D to formula (10):

[0068] y = b + Uh(w t-k , ..., w t+k ;W,,D) (10)

[0069] Once the network is sufficiently trained, we can obtain a distributed representation of each document in the corpus; this, in turn, can be used for subsequent text mining tasks, such as clustering or classification. In this study, we trained PV-DM and PV-DBOW, both of which are the main structures of the DBOW model, and utilized their concatenated vectors to improve classification performance, as proposed by the authors in the original paper.

[0070] II. Structured Feature Extraction

[0071] In this section, the invention applies the Node2Vec model, an efficient and scalable algorithm for network feature learning. This algorithm conforms to established principles in network science, providing flexibility for discovering representations that meet different equivalence criteria. It can be divided into three stages, executed sequentially: preprocessing to compute transition probabilities, random walk simulation, and optimization using SGD. Each stage is parallelizable and executed asynchronously, which contributes to the overall scalability of the algorithm. We will now briefly describe the details of these three stages.

[0072] 2.1 Calculate the transition probability

[0073] The first step of the Node2Vec algorithm is to select an appropriate neighborhood concept, which allows for the learning of representations based on the node's network role and / or its learned representation. This is achieved by developing a flexible biased random walk process that can explore the neighborhood in both breadth-first search (BFS) and depth-first search (DFS) modes. The BFS and DFS processes in service relation networks can be implemented... Figure 4 Found it.

[0074] Specifically, Node2Vec defines a second-order random walk, guided by two parameters, p and q. Parameter p controls the probability of immediately revisiting nodes in the walk, while parameter q allows the search to distinguish between "inward" and "outward" nodes. Both parameters allow the search process to interpolate between BFS and DFS, as detailed below. Figure 4 As shown. Consider a random walk that has just traversed edge (t, v) and is now residing on node v. For the next step of execution, π on edge (v, x) guided from v will be evaluated. vx The transition probability. The unnormalized transition probability is set to π. vx =α pq (t, x)·w vx .

[0075]

[0076] Where d tx This represents the shortest path distance between nodes t and x.

[0077] 2.2 Random Walk

[0078] Random walks provide a convenient mechanism to improve the effective sampling rate by reusing samples across different source nodes. By simulating a walk of length l, where l > k, k samples from k nodes are generated at a time due to the Markov property of random walks. Since all nodes have learned representations, a random walk of length l is simulated starting from each node. Formally, the i-th node in the walk is denoted as c. i And starting from c0 = u, node c i Generated from the following distribution:

[0079]

[0080] Where π vx Z is the unnormalized transition probability between nodes u and x, and Z is the normalization constant.

[0081] 2.3 Optimization Phase

[0082] The Node2Vec algorithm describes feature learning in a network as a maximum likelihood optimization problem. To address this problem, the authors extend the Skip-Gram structure for feature learning with a stochastic process that samples many different neighborhoods of a given source node u.

[0083] Formally, for each source node u∈V in a given network G=(V,E), the network neighborhood of node u generated by the neighborhood sampling strategy S is defined, denoted as: In addition, Let be the mapping function from nodes to the feature representations to be learned, where d represents the dimension of the feature representation. To learn the features, the following objective function is optimized, which maximizes the observation of the network neighborhood N of node u based on the feature representation f. S Log probability of (u):

[0084] f = max∑ u∈V log Pr(N S (u)|f(u)) (13)

[0085] By assuming the conditional independence of the observed neighboring nodes and the symmetry in the feature space, the optimization problem becomes tractable.

[0086] III. Multilayer Perceptron Model

[0087] A Multilayer Perceptron (MLP) is an artificial neural network with a directed structure that maps a set of input vectors to a set of output vectors. An MLP can be viewed as a directed graph consisting of multiple layers of nodes, each fully connected to the layer below. Each node, except for the input nodes, is a neuron with a non-linear activation function (or processing unit). A supervised learning method called backpropagation is frequently used to train MLPs. MLPs are a generalization of perceptrons, overcoming their inability to recognize linearly indivisible data. Recent developments focus on designing the structure of MLPs to better hide relation extraction. In this layer, if the input is a concatenated dense representation vector, combined features are automatically learned by the fully connected layers. Notably, the definition of the loss function is an integral part of an MLP. The widely used loss function in service classification methods is the cross-entropy loss function, which applies the labels of candidate services to supervise the overall prediction.

[0088]

[0089] Where x is the multidimensional feature representation vector of the service, and T is a training set of size N. y∈{0,...,n} represents the true label of the service. p(x) is the output of the network, which is also the predicted value of sample x.

[0090] Example:

[0091] In this embodiment, the classification method provided by the present invention was experimentally verified. The dataset, experimental setup, evaluation metrics, comparison methods, and experimental results of this embodiment are described in detail below.

[0092] Dataset and Experiment Setup:

[0093] We conducted experiments using a real-world dataset to obtain robust results. The dataset was crawled from the Programmable Web and is publicly available. It is accessible from the online website. The newly updated dataset includes 12,919 Web APIs and 6,206 Mashups. Each API and Mashup has a descriptive document, along with some tags provided by the developer or user. There are 312 categories for Mashup services, so the average number of Mashups per category is 6206 / 312 = 19.89, although the number of Mashups varies considerably within each category.

[0094] Of all Web APIs, only 940 were invoked by the Mashups, representing 7.28% (940 / 12919). There were 9297 interactions between the Mashup and the invoked Web API services. The sparsity of our Mashup-API matrix is ​​defined as follows:

[0095]

[0096] Therefore, the dimension of the Mashup-API matrix is ​​6206940, and the sparsity is 99.84%, which can be calculated using the formula above. In summary, Tables 1 and 2 describe the characteristics of the dataset. Furthermore, to prevent the uneven distribution of the dataset samples from affecting the experimental results, we only selected the first 20 classes of Mashup (3928) and API (6718) for the experiment. Detailed distributions are shown in Tables 3 and 4.

[0097] In this invention, all performance values ​​are averages over 5 rounds. The default values ​​for hyperparameters in LDN and its competitors are shown in Table 5. It should be noted that if a hyperparameter in the table above does not indicate which dataset it is, the default is that the hyperparameters are the same for both datasets. Since we categorize all web services into the top 20 classes, we set the number of topics for all methods included in LDA to 20, where each potential topic corresponds to a specific web service domain.

[0098] Table 1: Key Information about the Mashup Dataset

[0099]

[0100] Table 2: Key Information about the API Dataset

[0101]

[0102] Table 3 lists the top 20 most numerous Mashup categories.

[0103]

[0104] Table 4 lists the top 20 most frequent API categories.

[0105]

[0106] Table 5 Main Hyperparameter Settings

[0107]

[0108] Evaluation indicators:

[0109] Generally, the basic indicators for evaluating classification results are as follows:

[0110] • True positive (TP): Samples belonging to category A are correctly classified as category A;

[0111] • False positive (FP): A sample that does not belong to category A is incorrectly classified as category A;

[0112] • True negative (TN): Samples that do not belong to category A are correctly classified into other categories;

[0113] • False negative (FN): A sample belonging to class A is incorrectly classified as another class.

[0114] This invention uses cross-entropy loss, Macro F1, and Micro F1 scores as performance evaluation indicators. Formula (14) gives the definition and calculation method of cross-entropy loss. Generally, F1 scores are used for binary classification. So, for multivariate classifiers, are there similar F1 score metrics? The answer is yes, there are two commonly used ones, one called Macro F1 and the other called Micro F1. Macro F1 does not consider label imbalance; it calculates the metric for each label and finds their unweighted mean. Meanwhile, Micro F1 calculates the metric by statistically analyzing the total number of true positives, false negatives, and false positives globally. Specifically, the formula for calculating the Macro F1 score for Web service classification is as follows:

[0115]

[0116]

[0117]

[0118] The Micro F1 score is calculated using formulas (19), (20), and (21). The smaller the cross-entropy loss value, the higher the Macro F1 and Micro F1 scores, and the better the classification performance. For simplicity, we record the above three evaluation metrics as Loss, Ma-F1, and Mi-F1, respectively.

[0119]

[0120]

[0121]

[0122] Comparison method:

[0123] In this section, we compare our method with the following methods to verify the effectiveness of the proposed method and the necessity of combining structured and unstructured features. It is worth noting that all methods first obtain feature vectors, and then use these vectors as inputs to the MLP layer for classification prediction. A summary of the methods is shown in Table 6.

[0124] 1) LDA: The topic vector is obtained using the LDA model. Each service belongs to a unique topic with the highest topic probability value. Network services with the same specified topic are more likely to be classified together.

[0125] 2) Doc2Vec: Doc2Vec is an unsupervised learning algorithm used to predict a vector to represent different documents. The model's structure overcomes the shortcomings of the bag-of-words model.

[0126] 3) LD: This method uses LDA and Doc2Vec models to represent unstructured features. It combines a topic distribution model and a neural network-based document embedding model.

[0127] 4) LD-T: This method uses LDA and Doc2Vec models to represent unstructured features. Furthermore, it utilizes the Node2Vec model to obtain structured labeled relation vectors.

[0128] 5) LD-I: This method uses LDA and Doc2Vec models to represent unstructured features. Furthermore, it utilizes the Node2Vec model to obtain a structured call relationship vector.

[0129] 6) LDN: This invention proposes a method that utilizes both structured and unstructured information to facilitate the Web service classification process. Specifically, this method employs LDA and Doc2Vec models to represent unstructured features. Furthermore, it utilizes the Node2Vec model to obtain structured call relationship vectors and structured label relationship vectors.

[0130] Table 6 Summary of Comparison Methods

[0131]

[0132] Experimental Results and Analysis:

[0133] Tables 7 and 8 show the results of the LDN model and other comparative methods under different evaluation metrics.

[0134] Based on the experimental results, we can draw the following observations:

[0135] On the Mashup and API datasets, LDN significantly outperforms all other methods across various metrics by setting up the same configurations as closely as possible. LDN's Ma-F1 score is 121.59% higher than LDA, 116.65% higher than Doc2Vec, 97.75% higher than LD, 7.70% higher than LD-T, and 24.64 higher than LD on the Mashup dataset. For the API dataset, LDN's Ma-F1 score is 103.76% higher than LDA, 53.82% higher than Doc2Vec, 42.66% higher than LD, 1.74% higher than LD-T, and 38.66 higher than LD-I. The loss and Mi-F1 results are generally consistent. The most important reason behind these results is that LDN fully utilizes service network relational information and service unstructured semantic information to improve classification accuracy. Although other comparable methods have the ability to represent unstructured information, LDA, Doc2Vec, and LD struggle to obtain more comprehensive feature embeddings. Meanwhile, LD-I and LD-T outperform unstructured methods in classification performance, but fall short of TLD methods. This is attributed to the fact that LD-I and LD-T only consider a naive combination of service semantic information and a single structural feature. By comparison, based on an efficient combination of the two document embedding methods, our method can smoothly embed the service network into a low-dimensional representation by modeling their structural approximations.

[0136] Table 7 Comparison of Experimental Results for the Mashup Dataset

[0137]

[0138] Table 8 Comparison of Experimental Results for the Mashup Dataset

[0139]

[0140] Overall, the classification performance of the API dataset is better than that of the Mashup dataset. We believe the possible reasons are as follows: 1) As shown in Tables 1 and 2, the API dataset is larger than the Mashup dataset, with richer categories, labels, and interactions, thus providing a more comprehensive feature representation, which is beneficial for classifier training; 2) As shown in Tables 3 and 4, the API dataset has a more uniform distribution and more standardized description documents than the Mashup dataset, which helps the classifier achieve better results.

[0141] Beyond improved performance, LDN is more meaningful by explaining the importance of each sub-model. Combining multi-dimensional features is instructive for further improving service classification performance. We can observe that LD-T significantly improves classification performance compared to LD-I on the Mashup and API datasets. These experimental phenomena indicate that structured labeling relationships have a much greater impact on classification performance than structured calling relationships. In other words, removing LDA topic information and structured labeling relationships from the Mashup and API representation vectors may lead to greater performance degradation, implying that LDA and structured labeling relationships contribute more significantly to service classification.

[0142] Hyperparameter comparison analysis:

[0143] Since this invention involves many hyperparameters, we primarily discuss the key parameters of the MLP, which are crucial for training the classifier, including the number of hidden layers, learning rate, and number of training iterations. Table 5 describes the range and default values ​​of the parameters; while the effect of one parameter is being evaluated, the others are set to their default values.

[0144] 1) The impact of hidden layers

[0145] Theoretically, deeper hidden layers result in a stronger ability to fit the function and better performance. However, in reality, deeper layers can not only lead to overfitting but also increase the difficulty of training, making the model less likely to converge. To study the impact of hidden layers, we set the number of hidden layers to 1 to 4, with the number of hidden layer units set to 256, 128, 64, and 32, respectively. Figure 6 (ac) and Figure 7 As shown in (ac), the loss value consistently increases with increasing the number of hidden layers, regardless of whether it's on the Mashup or API datasets. When the number of hidden layers is set to 2, the Ma-F1 and Mi-F1 values ​​initially show a decreasing trend, then an increasing trend. Therefore, we choose a hidden layer count of 2 in our method.

[0146] 2) The impact of learning rate

[0147] The learning rate is a hyperparameter of LDN that controls how we adjust the step size of the MLP in each iteration, moving towards the minimum of the loss function. A lower slope means we move more slowly down the slope; a higher learning rate makes us more likely to miss local optima. Therefore, carefully choosing the learning rate for our method is crucial. To obtain the optimal learning rate, we set it to 0.01, 0.05, 0.1, 0.15, 0.2, and 0.3. Figure 6 (df) and Figure 7(df) Plots the performance variation of LDN. We first observe that when the learning rate is set to 0.01-0.1 on the Mashup dataset, increasing the learning rate improves performance. However, the improvement in classification performance on the API dataset stops when the learning rate is set to 0.15. This is because a learning rate that is too small can cause the process to stall, and LDN cannot approach local minima. However, since the learning rate values ​​on the Mashup dataset range from 0.1 to 0.3, and on the API dataset from 0.15 to 0.3, the classification performance gradually decreases. This phenomenon may be caused by an excessively large learning rate leading to a suboptimal convergence rate. Therefore, in our experiments, the default learning rate was set to 0.01 on the Mashup dataset and 0.15 on the API dataset.

[0148] 3) The impact of training sessions

[0149] In this invention, the number of training iterations represents the number of times the model is fully trained using the complete training set data. Generally, as the number of training iterations increases, the classifier learns more implicit information. However, too many training iterations can easily lead to overfitting, thereby reducing classification performance. To investigate the impact of the number of training iterations, we set the number of training iterations to between 2500 and 2000, with a step size of 2500. Figure 6 (gi) and Figure 7 As we can observe (gi), on both the Mashup and API datasets, as the number of training iterations increases, the classification performance first increases and then decreases after certain values, verifying that too many or too few training iterations are detrimental to the classification results. Specifically, around 12500 training iterations yielded relatively good performance in terms of loss, Ma-F1, and Mi-F1. This observation suggests that a larger number of training iterations leads to better classification results.

[0150] This invention proposes a novel Web Service Classification (LDN) method aimed at improving classification accuracy by combining multidimensional features. First, we learn a combined service unstructured embedding based on two document representation methods: LDA and Doc2Vec. The unstructured embedding integrates descriptive information and other auxiliary information (such as popularity, tags, etc.). Second, we propose to preserve service network relationships through a set of low-dimensional vectors implemented using the recently proposed network embedding technique Node2Vec. Finally, we design a multilayer perceptron for learning an enhanced Web service classifier that benefits from the feature embedding vectors from both aspects. Extensive experiments on real-world datasets demonstrate that this method can accurately fuse unstructured information and structural relationships, thereby improving the classification accuracy of Web services. Comparative experiments on real-world datasets illustrate the effectiveness and importance of various features for the classification results, validating the necessity of combining multidimensional features.

Claims

1. A method for classifying Web services that integrates unstructured and structured information, characterized in that, Includes the following steps: (1) Unstructured feature extraction: Web services are embedded in an unstructured manner based on a combination of LDA and Doc2Vec document representation methods; (2) Structured feature extraction: Service call network and service label network are constructed using the structural relationship information of the dataset; (3) Multilayer perceptron model: A multilayer perceptron model is designed, and the multilayer perceptron is trained to classify Web services by connecting all the representation vectors as input. In step (2), before obtaining the structured embedding, the Web service relationship network generation component is used to extract structured features from the structured information; The Web service relationship network is defined in two forms: (1) Service call network: In the service call network, the network nodes are Mashups or APIs. If two Mashups call the same API or two APIs are called by the same Mashup, then there is an edge between the two network nodes; (2) Service tag network: In the service tag network, the network nodes are Mashups or APIs. If two Mashups or APIs contain the same tag, then there is an edge between the two network nodes. In the process of embedding services into the network, the Node2Vec model was adopted and executed in three stages in sequence: preprocessing to calculate transition probabilities, random walk simulation, and optimization using SGD; each stage is parallelizable and executed asynchronously. In step (3), a connection layer is designed to fuse unstructured embeddings and structured relational embeddings. The cascaded multidimensional feature vectors are used as inputs to the MLP model, and the true category corresponding to each service is used as output. The Web service classifier that fuses multidimensional features is obtained by training the MLP model.

2. The Web service classification method that integrates unstructured and structured information according to claim 1, characterized in that, In step (1), a preprocessing process is performed on the Web service description document before the unstructured embedding of the Web service. The preprocessing process includes the following steps: (1) Use the pandas natural language processing toolkit in Python to extract relevant documentation descriptions of the Web API from the selected Web service; (2) Use the NLTK natural language toolkit in Python to segment words according to spaces and separate punctuation marks from words; (3) Use the stop word list in the NLTK Natural Language Toolkit in Python to remove stop words; (4) Stemonize words that are different in form but the same in substance; (5) Extract the words that appear in the processed Web service description document and perform dictionary processing; (6) Represent each word in the processed Web service description document and dictionary as a One-Hot vector, and then construct a feature matrix from the One-Hot vectors.

3. The Web service classification method that integrates unstructured and structured information according to claim 2, characterized in that, In step (1), after obtaining the preprocessed unstructured information, it is used as the input of the topic model LDA and the document embedding model Doc2Vec respectively, and the text is converted into a vector representation to obtain the combined unstructured embedding.