A web service representation method based on multi-view multi-level contrastive learning
By employing a multi-view, multi-level contrastive learning method, combined with Sentence-BERT and LightGCN models, the problem of insufficient utilization of textual and structural semantics in Web service representation is addressed, resulting in more accurate and efficient service representation and improved identification and recommendation performance of tail services.
Patent Information
- Application Number
- CN202510476595.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-04-16
AI Technical Summary
Existing Web service representation methods struggle to fully utilize textual and structural semantics, making it difficult to quickly find the most suitable service among a vast number of Web services, especially for tail services.
We employ a multi-view, multi-level contrastive learning approach. We extract textual representations using the Sentence-BERT model and structural representations using the LightGCN model. We perform local and global contrastive learning, integrate textual and structural information, and consider the popularity distribution of Web services to optimize the model's learning performance.
It improves the accuracy and efficiency of Web service representation, enhances fine-grained feature extraction, and improves the performance of service classification, retrieval, and recommendation, especially significantly improving the representation effect of tail services.
Smart Images

Figure CN120386948B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of Web service representation, and particularly relates to a Web service representation method based on multi-view multi-level contrastive learning. BACKGROUND
[0002] Web service (Web APIs) is a service model for data exchange and function invocation over the Internet, aiming to provide a flexible and efficient development approach for developers to support the rapid construction of Mashup applications. However, with the rapid increase in the number of Web services, users have difficulty in quickly finding the most suitable service among a large number of options, leading to the "choice difficulty" problem. In addition, traditional Web service classification methods face challenges in processing large-scale data, which makes efficient Web service discovery and classification a research hotspot. Service representation is the basis for tasks such as service discovery and service classification, because the quality of service representation directly affects the performance of these tasks.
[0003] In recent years, service representation methods have been continuously developed, which can be generally divided into three types: content-based methods, graph-based methods, and hybrid methods. Content-based service representation methods rely on service quality text descriptions, focusing on extracting semantic features from text, including service name, description, input and output parameters, category labels, etc. Content-based representation methods parse documents into structured information, and convert services into feature vectors through feature extraction and representation learning technologies such as BERT and DNN. Graph-based service representation methods treat services as nodes in a graph and use graph neural network models for node representation, emphasizing the interaction between services. The idea is that service function semantics are implicitly contained in service network structure. In this type of work, network representation methods such as Node2Vec, LightGCN, GAN, and GAT are commonly used. Although it is possible to embed users and services by learning network representations from service networks, many existing works only focus on structural semantics while ignoring textual semantics. In order to fully utilize textual semantics and structural semantics, hybrid-based methods extract textual semantics and structural semantics from functional description documents and service networks respectively to achieve service representation. This type of method has made great improvements in service representation performance.
[0004] Although hybrid-based methods have made great progress in service representation, it is difficult to effectively extract rich semantics from service description documents and service networks due to the limitations of information in service description documents and service networks. In addition, Web services have a characteristic of popularity distribution, but most existing works ignore this problem, making it difficult for the model to complete the representation of tail services. SUMMARY
[0005] In view of the above technical problems, the present application provides a Web service representation method based on multi-view multi-level contrast learning to solve the problems of the prior art.
[0006] The present application provides a Web service representation method based on multi-view multi-level contrast learning, comprising:
[0007] Obtaining a programmable Web dataset;
[0008] Based on the programmable Web dataset, obtaining Mashup text description and Web API text description;
[0009] Inputting the Mashup text description and Web API text description into a Sentence-BERT model to obtain Mashup text representation and Web API text representation;
[0010] Inputting the programmable Web dataset into a Web service interaction network model to obtain Mashup structure representation and Web API structure representation;
[0011] Respectively performing global contrast learning on the corresponding text representation and structure representation to obtain corresponding global feature information;
[0012] Summing up the corresponding global feature information to obtain a Web representation vector.
[0013] Optionally, obtaining Mashup text representation and Web API text representation comprises:
[0014] Performing dimension reduction processing on the output result of the Sentence-BERT model through a multi-dimensional perception machine to obtain the Mashup text representation and Web API text representation.
[0015] Optionally, the Web service interaction network model comprises a Mashup-API interaction network sub-model, a Mashup-Tag interaction network sub-model and an API-Tag interaction network sub-model;
[0016] The Mashup-API interaction network sub-model comprises a Mashup-API network and a LightGCN model;
[0017] The Mashup-Tag interaction network sub-model comprises a Mashup-Tag network and a LightGCN model;
[0018] The API-Tag interaction network sub-model comprises an API-Tag network and a LightGCN model;
[0019] The LightGCN model is used for graph convolution processing on a Mashup-API network, a Mashup-Tag network and an API-Tag network respectively to obtain structure representation vectors.
[0020] Optionally, the programmable Web dataset is input into a Web service interaction network model to obtain Mashup structure representation and Web API structure representation, including:
[0021] The programmable Web dataset is input into a Mashup-API interaction network sub-model to obtain a first Mashup embedding vector and a first Web API embedding vector.
[0022] The programmable Web dataset is input into a Mashup-Tag interaction network sub-model to obtain a first Tag embedding vector and a second Mashup embedding vector.
[0023] The programmable Web dataset is input into an API-Tag interaction network sub-model to obtain a second Tag embedding vector and a second Web API embedding vector.
[0024] The corresponding embedding vectors are divided and different weights are assigned for local contrast learning to obtain the Mashup structure representation and the Web API structure representation.
[0025] Optionally, the local contrast learning includes:
[0026] The first Mashup embedding vector and the second Mashup embedding vector are subjected to local contrast learning by using a first local contrast loss function to obtain the Mashup structure representation.
[0027] The first Web API embedding vector and the second Web API embedding vector are subjected to local contrast learning by using a second local contrast loss function to obtain the Web API structure representation.
[0028] The Mashup Tag embedding vector and the Web API Tag embedding vector are subjected to local contrast learning by using a third local contrast loss function, aiming to promote the learning of service features in the interaction network convolution process.
[0029] Optionally, the first local contrast loss function is:
[0030]
[0031] The second local contrast loss function is:
[0032]
[0033] The second local contrast loss function is:
[0034]
[0035] wherein, denotes the local contrast learning loss value corresponding to Mashup, denotes the local contrast learning loss value corresponding to API, denotes the local contrast learning loss value corresponding to Tag, denotes the Mashup set, m i denotes the i-th Mashup, denotes the Web API set, a i denotes the i-th API, denotes the Tag set, t i denotes the i-th tag, denotes the structural representation vector corresponding to the i-th Mashup in the G MA view, denotes the structural representation vector corresponding to the i-th Mashup in the G MT view, denotes the structural representation vector corresponding to the i-th Web API in the G MA view, denotes the structural representation vector corresponding to the i-th Web API in the G AT view, denotes the structural representation vector corresponding to the i-th tag in the G MT view, denotes the structural representation vector corresponding to the i-th tag in the G AT view, s(·,·) is used to calculate the similarity between two vectors, τ1 is a temperature parameter, and α is a hyperparameter for controlling the attention weight of the model to different samples, is the same Web API set, is the different category Web API set.
[0036] Optionally, the corresponding text representation and the structural representation are subjected to global contrast learning respectively to obtain corresponding global feature information, including:
[0037] The first global contrast loss function is used to perform global contrast learning on the Mashup text representation and the Mashup structural representation to obtain Mashup global feature information;
[0038] The second global contrast loss function is used to perform global contrast learning on the Web API text representation and the Web API structural representation to obtain Web API global feature information.
[0039] Optionally, the first global contrast loss function is:
[0040]
[0041] The second global contrast loss function is:
[0042]
[0043] wherein, denotes the global contrast learning loss value corresponding to the Mashup, denotes the global contrast learning loss value corresponding to the Web API, denotes the text representation vector corresponding to the i-th Mashup, denotes the text representation vector corresponding to the i-th API, denotes the structure representation vector corresponding to the i-th Mashup, is the structure representation vector corresponding to the i-th API, s(·,·) is used to calculate the similarity between two vectors, τ2 is a temperature coefficient in the contrast learning function, and α is a hyperparameter for controlling the attention weight of the model to different samples, is the same Web API set, is the Web API set of different categories.
[0044] Compared with the prior art, the present application has the following technical solutions and technical effects:
[0045] The present application simultaneously considers the feature information of Web services under multiple views. First, the service text description is preprocessed, and the text representation is extracted using the Sentence-BERT model. Then, the Web interaction network is decomposed into three subgraphs, and the structure representation is extracted using the LightGCN model. On this basis, the text representation and the structure representation are semantically aligned through a multi-layer neural network. In the convolution process of the three sub-views, local contrast learning is added to extract the fine-grained features of Web services. At the same time, according to the data popularity distribution, the Web APIs are divided into head APIs and long-tail APIs, and different weights are assigned to optimize the learning effect of the model. Finally, through global contrast learning, the text semantic representation and the structure semantic representation are associated and complement each other's semantic information, thereby improving the accuracy of both. Finally, the text representation and the structure representation are weighted to obtain the final representation of the service.
[0046] The technical effects of the present application mainly lie in the following aspects:
[0047] 1. Comprehensive and accurate feature extraction: Fusing text and structure information, extracting features from multiple views to avoid the limitations of single view. Utilizing Sentence-BERT and LightGCN models to extract text and structure representations respectively, accurately depicting Web service features and providing rich feature information for subsequent model learning.
[0048] 2. Fine-grained feature extraction enhancement: Adding local contrastive learning in sub-view convolution to strengthen the model's attention to local details and extract more discriminative fine-grained features, which helps improve the accuracy and efficiency of Web service tasks.
[0049] 3. Model learning effect optimization: According to the popularity distribution of Web API data, divide APIs into head and long-tail APIs and assign different weights to balance the contribution of different categories of data, optimize the model learning effect, and improve the generalization ability and adaptability.
[0050] 4. Semantic association and accuracy improvement: Through global contrastive learning to associate text and structure semantic representations, realize semantic complementation, improve the accuracy and richness of semantic representations, more comprehensively understand the semantic connotation of Web services, and provide more accurate matching and recommendation results.
[0051] 5. Final representation effectiveness enhancement: Weighted fusion of optimized text and structure representations to obtain more representative and discriminative service final representations, significantly improving the performance and effect of Web service classification, retrieval, recommendation, and other tasks. BRIEF DESCRIPTION OF DRAWINGS
[0052] The accompanying drawings, which form a part of this application, are intended to provide further understanding of the application and are incorporated herein in their entirety. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0053] Figure 1 is a flow chart of a Web service representation method based on multi-view multi-level contrastive learning according to an embodiment of the present application;
[0054] Figure 2 is an architecture diagram of a Sentence-BERT model according to an embodiment of the present application;
[0055] Figure 3 is a LightGCN framework diagram according to an embodiment of the present application;
[0056] Figure 4 is a contrastive learning diagram according to an embodiment of the present application;
[0057] Figure 5 is a comparison experiment diagram of a service recommendation task according to an embodiment of the present application;
[0058] Figure 6A comparison experiment graph for a service classification task in a Mashup dataset according to an embodiment of the present application;
[0059] Figure 7 A comparison experiment graph for a service classification task in a WebAPI dataset according to an embodiment of the present application;
[0060] Figure 8 A curve graph of the influence of a hyperparameter in a model according to an embodiment of the present application. DETAILED DESCRIPTION
[0061] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments.
[0062] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown.
[0063] To solve the problem of how to combine the text view and structure view features of Web services to complete service representation, in order to improve the service representation performance of existing methods, the embodiment first uses Sentence-BERT to obtain the representation vector of the service description document, uses the LightGCN model to perform graph convolution on the Mashup-API, Mashup-Tag, and API-Tag interaction graphs to obtain the structural representation of Web services in different views, and adds local contrast learning in the convolution process, while considering the popularity distribution problem of Web services, then further performs global contrast learning on the text and structure representation, and finally weights the representation in the two different semantics to obtain the final representation of the Web service.
[0064] As shown in Figure 1 The embodiment proposes a Web service representation method based on multi-view multi-level contrast learning, which specifically includes the following steps:
[0065] Obtain a programmable Web dataset;
[0066] Based on the programmable Web dataset, obtain Mashup text description and Web API text description;
[0067] Input the Mashup text description and the Web API text description into the Sentence-BERT model to obtain Mashup text representation and Web API text representation;
[0068] inputting the programmable Web dataset into a Web service interaction network model to obtain Mashup structure representation and Web API structure representation;
[0069] respectively performing global contrastive learning on the corresponding text representation and structure representation to obtain corresponding global feature information;
[0070] adding the corresponding global feature information to obtain a Web representation vector.
[0071] Specifically, the embodiment aims to improve the representation effect of Web services by fusing text semantics and structure semantics. First, the Sentence-BERT model is used to extract the text semantic representation of Mashup and Web API, and the LightGCN model is used to extract the structure semantic representation thereof. The text representation output by the Sentence-BERT model is processed by dimension reduction to ensure that the embedding dimension is consistent with the structure semantic embedding dimension output by the LightGCN model. On this basis, through local contrastive learning, the model can capture fine-grained feature information of Web services. Further, through global contrastive learning, the text representation and the structure representation are semantically aligned to realize the complementation of semantic information, thereby improving the accuracy of the text semantic representation and the structure semantic representation. The embodiment applies the representation result to service recommendation and service classification tasks, and uses real data of the ProgrammableWeb platform to verify the experiment. The experimental results show that, compared with the baseline method, the multi-view multi-level contrastive learning method proposed in the embodiment exhibits better performance in various evaluation indicators, proving the effectiveness of the method.
[0072] More specifically, the multi-view multi-level contrastive learning Web service representation method framework proposed in the embodiment is as shown in Figure 1 , which mainly includes four steps:
[0073] First, the embodiment mainly includes four steps: based on the text description of Mashup and Web API, the Sentence-BERT model is used to obtain the text representation of Mashup and the text representation of Web API, respectively;
[0074] Secondly, the Web service interaction network structure is divided into three sub-views of Mashup-API, Mashup-Tag and API-Tag, and the LightGCN model is used to respectively convolve the three sub-views to obtain corresponding representation vectors, and the representation vectors under the three views are added to obtain the structure representation of Mashup and Web API;
[0075] Then, local contrastive learning is used to extract fine-grained feature information of Web services, and different contrastive learning weights are assigned according to the feature distribution of the popularity of Web API;
[0076] Finally, global contrastive learning is performed on the semantic representation and structural representation of Mashup and Web API, and the final representation vector is obtained by weighting the text representation and the structural representation of Web service.
[0077] The representation of Web service is obtained by the above-mentioned method based on multi-view and multi-level contrastive learning.
[0078] The data preprocessing, model construction and joint training of the embodiment are described in detail as follows:
[0079] Data preprocessing:
[0080] The crawled Mashup and Web API text information is processed to make it suitable for model input. Specifically, the natural language preprocessing method is used to preprocess the function description documents of Mashup and Web API, including normalization, stem extraction, tokenization and stop word deletion. The interaction network of Web service is deconstructed to generate Mashup-API, Mashup-Tag and API-Tag three sub-views, and the preprocessing process includes the following steps:
[0081] 1. Extract the Mashup name column, the called Web API column, the Mashup text description column, the Mashup Tag column, the Web API name column, the Web API text description column and the Web API Tag column of the ProgrammableWeb dataset;
[0082] 2. Delete the Mashup that uses externally imported Web API;
[0083] 3. Delete the Web API that is not called;
[0084] 4. Number it, and construct Mashup-API, Mashup-Tag and API-Tag three sub-views according to the interaction records of Mashup, Web API and Tag.
[0085] Model construction and joint training:
[0086] The overall process of the M2CL4SRL method consists of four main parts:
[0087] (1) Obtain the text representation of Mashup and Web API: use the Sentence-BERT model to obtain the text representation of Mashup and Web API respectively;
[0088] (2) input the Mashup-API, Mashup-Tag, API-Tag interaction network into the LightGCN model to obtain the structural representation of the Mashup and the structural representation of the Web API;
[0089] (3) adopt local contrast learning to align the structural representation from the LightGCN, and assign different learning weights according to the popularity distribution attribute of the Web API to learn the fine-grained features of the Web service;
[0090] (4) adopt global contrast learning to align the semantic representation information and the structural representation information of the Mashup and the Web API, and weight the text representation and the structural representation of the Web service to obtain the final representation vector.
[0091] Further, obtaining the Mashup text representation and the Web API text representation comprises:
[0092] performing dimension reduction processing on the output result of the Sentence-BERT model through the multi-dimensional perception machine to obtain the Mashup text representation and the Web API text representation.
[0093] Specifically, the text encoder of the service representation comprises:
[0094] The content-based service representation is extracted from the description text of the Mashups and the Web APIs. In order to achieve this goal, the Sentence-BERT model is used as a text encoder to complete the feature extraction task in the text description in the embodiment. The model is based on a twin network and uses the BERT framework to generate sentence embedding vectors. Compared with the standard BERT, the Sentence-BERT significantly improves the inference speed while maintaining excellent performance, making it one of the leading methods for sentence encoding in natural language processing. Therefore, the Sentence-BERT is used to encode the service description text. Specifically, the all-mpnet-base-v2 version of the Sentence-BERT is used in the embodiment. The version is based on the pre-training model of microsoft / mpnet-base and is fine-tuned on a dataset containing 1 billion sentences to optimize performance. Figure 2 The overall framework of the Sentence-BERT is shown. The model first generates a sentence embedding vector using BERT, and then applies a pooling strategy to extract the sentence representation from the context-rich word embedding vector. The pooling method includes three strategies: using the output of the [CLS] token (CLS pooling), calculating the mean of all output vectors (MEAN pooling), and calculating the maximum value of the output vector (MAX pooling). The default strategy is MEAN pooling, which calculates the average of all vectors.
[0095] Before text representation, general preprocessing techniques such as normalization, stemming, tokenization, and stopword removal are applied to the functional description documents. These operations are crucial to improve the performance of subsequent models. The preprocessed functional description documents of Mashup and Web API are then input into the Sentence-BERT model to generate initial text embedding vectors. Next, a multi-layer perceptron (MLP) model is used to further transform the text representation to ensure that the text embedding dimension is consistent with the embedding dimension of the structural representation. The MLP model consists of three layers: an input layer, a hidden layer, and an output layer, as defined in equation (1). The specific formula of the multi-layer perceptron is as follows:
[0096] f(x) = σ2(W2(σ1(W1x + b1) + b2))#(1)
[0097] Where W, b, and σ represent weights, biases, and activation functions, respectively. Through the multi-layer perceptron (MLP), the text embedding vectors of Mashup m and Web API a are represented as and The embedding dimension of the text representation obtained from Sentence-BERT is 384. To ensure the operation of the model, the dimension of the text embedding vector must be consistent with the embedding vector dimension of the graph structure. Therefore, the MLP is designed to adjust the dimension of the text embedding vector.
[0098] Further, the Web service interaction network model includes: a Mashup-API interaction network sub-model, a Mashup-Tag interaction network sub-model, and an API-Tag interaction network sub-model;
[0099] The Mashup-API interaction network sub-model includes: a Mashup-API network and a LightGCN model;
[0100] The Mashup-Tag interaction network sub-model includes: a Mashup-Tag network and a LightGCN model;
[0101] The API-Tag interaction network sub-model includes: an API-Tag network and a LightGCN model;
[0102] Wherein, the LightGCN model is used to perform graph convolution processing on the Mashup-API network, the Mashup-Tag network, and the API-Tag network, respectively, to obtain structural representation vectors.
[0103] Specifically, the structural encoder of service representation:
[0104] The Web service network is considered as a heterogeneous graph composed of Mashups, Web APIs and Tags, denoted as G = (G MA , G MT , G AT ). The Mashup-API network is denoted as G MA = {V m , V a , E ma}, where: is the set of Mashups; is the set of Web APIs; E ma represents the invocation relationship between Mashups and Web APIs, i.e., if Mashup m i interacts with Web API a i , then E ma (i,j) = 1, otherwise E ma (i,j) = 0. G MT = {V m , V t , E mt} denotes the Mashup-Tag network, where: V m is the set of Mashups; V t is the set of Tags; E mt represents the tagging relationship between Mashups and Tags. G AT = {V a , V t , E at} denotes the API-Tag network, where: V a is the set of Web APIs; V t is the set of Tags; E at represents the tagging relationship between Web APIs and Tags.
[0105] To capture the interaction preferences and feature information of Mashups and Web APIs, the Web service network is decomposed into subgraphs G MA , G MT and G AT , and the convolution operation is applied. Based on its lightweight and efficient characteristics, LightGCN is selected as the graph encoder to extract the structural information of Web services, and its framework is shown in Figure 3 .
[0106] 2.1 Embedding layer:
[0107] In the embedding layer, first, node initialization is performed based on the adjacency matrix of the graph. In G MA , the embedding of each Mashup (Web API) node is represented as Mashups and Web APIs in G MA The structural embedding in is defined by formulas (2) and (3).
[0108]
[0109] 2.2 Embedded Propagation Layer:
[0110] The propagation layer updates the characteristics of the current node by aggregating information from its neighboring nodes. Specifically, this is achieved by introducing... To control the importance of the features of each neighboring node, where and These represent the neighboring nodes of Mashupm and Web APIa, as defined in equations (4) and (5), respectively. G MA The k-th layer embeddings of Mashup nodes and WebAPI nodes are used. Matrix operations allow for efficient handling of the propagation process for all nodes. Unlike traditional Graph Convolutional Networks (GCNs), LightGCN abandons feature transformations and non-linear activations, and this method has been shown to maintain model performance while significantly reducing time complexity.
[0111]
[0112] 2.3 Weighted Combination Layer:
[0113] After passing through k layers of GCN, in order to obtain the final representation of each node, the embeddings of all k layers are weighted and summed, where the weight of the k-th layer is set to... Defined as formula (6-7).
[0114]
[0115] Finally, the embedding vectors of the Mashup and API in the subgraph can be represented as: Similarly, for subgraph G MT G AT Perform the same operation as described above, and finally at G MT In the subgraph, Mashup and Mashup Tag can be used respectively. It means that in G AT In the subgraph, API and API Tag can be used separately. express.
[0116] make and These represent the paired training datasets defined below:
[0117] in Includes observed Mashup and WebAPI interactions. Includes unobserved Mashup and WebAPI interactions.
[0118] in Includes observed Mashup and Tag interactions. Includes unobserved Mashup and Tag interactions.
[0119] in Includes observed Web API and Tag interactions. Includes unobserved WebAPI and Tag interactions.
[0120] In G MA G MT and G AT In the graph convolution process, the loss function adopted is BPR (Bayes Personalized Ranking), as shown in formulas (8), (9) and (10).
[0121]
[0122] in, The goal of the BPR loss function is to minimize the log probability of effective triples, ensuring that the score of positive samples is higher than that of negative samples. Through weighted fusion of representations, the final structural representation of the Mashup and Web API is represented as follows: As defined by formulas (11) and (12).
[0123]
[0124] Here ω m and ω a It's a hyperparameter, ω m Controlling view G MA and G MT The weights between them, ω a Controlling view G MA and G AT The weights between them were set to 0.5 in the experimental example, with both hyperparameters set to 0.5 to preserve feature information within different views, thereby improving the model's comprehensive understanding of features from different views.
[0125] Furthermore, the programmable Web dataset is input into the Web service interaction network model to obtain Mashup structure representations and Web API structure representations, including:
[0126] inputting the programmable Web dataset into the Mashup-API interaction network submodel to obtain a first Mashup embedding vector and a first WebAPI embedding vector;
[0127] inputting the programmable Web dataset into the Mashup-Tag interaction network submodel to obtain a first Tag embedding vector and a second Mashup embedding vector;
[0128] inputting the programmable Web dataset into the API-Tag interaction network submodel to obtain a second Tag embedding vector and a second WebAPI embedding vector;
[0129] dividing the corresponding embedding vectors and assigning different weights for local contrast learning to obtain Mashup structure representation and WebAPI structure representation.
[0130] Further, the local contrast learning includes:
[0131] using a first local contrast loss function to perform local contrast learning on the first Mashup embedding vector and the second Mashup embedding vector to obtain Mashup structure representation;
[0132] using a second local contrast loss function to perform local contrast learning on the first WebAPI embedding vector and the second WebAPI embedding vector to obtain WebAPI structure representation;
[0133] using a third local contrast loss function to perform local contrast learning on the Mashup Tag embedding vector and the Web API Tag embedding vector, aiming to promote the learning of service features in the interaction network convolution process.
[0134] Further, respectively performing global contrast learning on the corresponding text representation and structure representation to obtain corresponding global feature information includes:
[0135] using a first global contrast loss function to perform global contrast learning on the Mashup text representation and the Mashup structure representation to obtain Mashup global feature information;
[0136] using a second global contrast loss function to perform global contrast learning on the WebAPI text representation and the WebAPI structure representation to obtain WebAPI global feature information.
[0137] Specifically, the contrast learning of service representation includes:
[0138] Contrast learning is a self-supervised learning method that learns meaningful feature representations by comparing the similarities and differences between samples. For example, Figure 4As shown, the core idea is to map "similar" samples to close representation space while pushing "different" samples away, thus capturing the true structure of data. In this study, M2CL4SRL effectively integrates the text semantic features and relationship structure features of services by combining local contrastive learning and global contrastive learning. Local contrastive learning alleviates the data sparsity problem through fine-grained feature extraction, while global contrastive learning enhances the overall performance of model representation. In addition, the model improves the learning ability of scarce samples by introducing a popularity-based weight allocation mechanism, thereby alleviating the suboptimal representation problem caused by uneven popularity distribution. Studies have shown that ignoring the popularity distribution problem can reduce the accuracy of model representation learning. Although contrastive learning methods can improve the effectiveness of representation learning, the popularity distribution may cause imbalance in feature learning during the positive and negative sample comparison process. For example, when the negative samples are mainly composed of popular items, the feature learning of unpopular items will be limited, thereby exacerbating the feature gap between unpopular items and popular items. Conversely, when the negative samples are evenly distributed, the optimization of popular items may further widen the feature gap between popular items and unpopular items, leading to insufficient feature learning of minority samples. This imbalance will directly affect the overall performance of the model. Therefore, it is necessary to adjust the weight of contrastive learning according to the popularity of samples to promote balanced learning of different sample types.
[0139] To solve this problem, the embodiment proposes a weighted contrastive module based on popularity distribution. According to the call frequency of Web API, it can be divided into and and assign different contrast weights to them, so that the model can learn more fine-grained features. Specifically, given a set of Web APIs According to its interaction frequency, it can be divided into two types: head API and tail API. Web API is defined as the top 30% of popular items in call frequency. The popularity category of each Web API is represented by c i , where c i = H represents the head Web API, and c i = L represents the tail Web API. Where The division strategy is shown in equations (13) and (14).
[0140]
[0141] In local contrastive learning, by utilizing the feature information in the three subgraphs, cross-view mutual supervision and cooperation are achieved, thus more effectively extracting structural information. In addition, the same labels in Mashup and Web API are also subjected to contrastive learning to capture potential functional information, thereby improving the quality of Web service representation. The local contrastive learning process is shown in equations (15-17).
[0142]
[0143] where cosine similarity is used to evaluate vector similarity, denoted as s(·). The hyperparameter τ affects the model's ability to distinguish between positive and negative samples, and α controls the attention weight of the model to different samples. The impact of the settings of the two on the model performance will be discussed in the subsequent experiments.
[0144] Global contrastive learning emphasizes learning feature information of Web services from a global perspective, aiming to integrate text semantics and structural features to enrich representation information. Global contrastive learning is defined as formulas (18-19)
[0145]
[0146] Through local and global contrastive learning, Mashup and WebAPI can be finally represented as as defined in formulas (20-21).
[0147]
[0148] More specifically, the representation optimization of multi-task learning is:
[0149] By summarizing the objective functions of each module, the final objective function of the model is defined as formula (22). Where L adopts a multi-task joint training strategy to balance the relationship between tasks of each module. At the same time, a regularization term is introduced to avoid model overfitting and maintain reasonable parameter adjustment during the training process, thereby enhancing the robustness and generalization ability of the model.
[0150]
[0151] where λ1 and λ2 control the weights of local and global contrastive learning losses, respectively. If the model pays too much attention to local contrast, it may ignore global information. Conversely, excessive emphasis on global contrast may lead to insufficient capture of local details. Therefore, by properly setting these two parameters, the model can strike a balance between learning local and global features, thereby improving the representation performance of the model.
[0152] The present embodiment will be described in detail in combination with experiments and accompanying drawings:
[0153] The experimental example outlines the experimental settings, including the data set, evaluation indicators and baseline methods. Then, the performance of the model under the Web service recommendation and Web service classification tasks is shown. Finally, the ablation study and hyperparameter analysis are discussed.
[0154] Data set and experimental settings:
[0155] The dataset used in the experiment was collected from ProgrammableWeb website in February 2022, containing 6,454 Mashups and 22,576 Web APIs. In order to ensure the quality of the training data, Mashups and Web APIs that lack descriptive text or invocation records were removed during the data preprocessing stage. Therefore, 5,750 Mashups and 1,188 Web APIs were included in the service recommendation task; and by filtering out the top 30 most frequent labels, the final classification dataset contained 4,089 Mashups and 847 Web APIs, as shown in Table 1.
[0156] Table 1 Experimental dataset
[0157]
[0158] Evaluation indicators:
[0159] Service recommendation task evaluation indicators: Precision, Recall, F1-Score, NDCG.
[0160] Service classification task evaluation indicators: Top-k Accuracy, Precision, Recall, F1-Score.
[0161] (1) Precision (Precision) refers to the ratio of the number of true hits to the total number of recommended Web APIs in the recommended Web API list, as shown in equation (23). Where TopKAPIs represents the actual Web API list with invocation relationship, and RealAPIs represents the recommended Web API list.
[0162]
[0163] (2) Recall (Recall) is used to evaluate the ability of the model to hit the real Web API, which is measured by calculating the ratio of the number of true hits to the total number of actual Web APIs, as shown in equation (24).
[0164]
[0165] (3) F1 score (F1-score) is the harmonic mean of precision (Precision) and recall (Recall), as shown in equation (25). F1 score is a comprehensive statistical indicator.
[0166]
[0167] (4) NDCG (Normalized Discounted Cumulative Gain) is an index used to evaluate the ranking quality of a recommendation system. NDCG measures the quality of the recommendation results by comparing the actual recommendation list with the ideal situation, and the specific calculation formula is shown in formula (28). The calculation method of NDCG is to divide DCG by IDCG, where the definitions of DCG and IDCG are shown in formulas (26) and (27), respectively.
[0168]
[0169] Top-K accuracy (Top-K Accuracy) is a commonly used evaluation index in classification tasks, which evaluates the proportion of instances in the first K predicted labels generated by the model that appear in the real labels, as shown in formula (29).
[0170]
[0171] where N is the total number of samples, is an indicator function that returns 1 when the real label y i appears in the first K predicted labels generated by the model, otherwise returns 0. Similar to the previous definition, in web service recommendation and classification tasks, precision (Precision), recall (Recall) and F1 score (F1-Score) all play similar roles.
[0172] Comparison method:
[0173] This embodiment verifies the effectiveness of the proposed representation method in service recommendation and classification tasks by comparing it with existing service recommendation and classification baseline methods. Specifically, in the recommendation task, content-based recommendation methods (NAFM, SANFM), graph-based recommendation methods (RWR, LightGCN, BPRMF) and hybrid recommendation methods (FSFM, SRCLML) are selected.
[0174] NAFM: Neural Attention Factorization Machine (NAFM) uses deep neural networks to model non-linear interactions between features and introduces an attention mechanism to evaluate the relative importance of these interactions.
[0175] SANFM: SANFM is a factorization machine model that introduces a self-attention mechanism to model feature weights in Web API recommendation, thereby capturing interactive features.
[0176] RWR: The RWR method uses a knowledge graph to model the interaction between services and performs graph traversal by restarting random walk, thereby completing the representation.
[0177] LightGCN: LightGCN is a simplified version of GCN that removes the non-linear activation and feature transformation in the forward propagation process, thereby reducing the computational complexity of graph convolution.
[0178] BPRMF: BPRMF is a Bayesian matrix factorization model widely used in collaborative filtering tasks in recommendation systems. It decomposes the user-item interaction matrix into low-dimensional feature matrices to capture user preferences and item characteristics.
[0179] FSFM: FSFM is a hybrid model that combines text semantic information and graph structure information, effectively fusing output vectors to complete the service recommendation task.
[0180] SRCLML: SRCLML simultaneously uses Transformer and LightGCN to extract text and structure features, and evaluates model performance through the service recommendation task.
[0181] In the classification task, this embodiment selects LSTM-based classification methods (LSTM, Bi-LSTM, CLSTM), CNN-based classification methods (CNN, RCNN), and other deep learning-based classification methods (ANFM4WSC, Serve-Net).
[0182] LSTM: LSTM is a special variant of recurrent neural networks, which is very suitable for processing time series or text data. It can effectively solve the gradient vanishing and explosion problems of traditional RNNs, and control the propagation of information through the gating mechanism, so as to better capture dependencies.
[0183] Bi-LSTM: Bi-LSTM is an extension of LSTM, which processes sequence data from two directions, and can capture both forward and backward context information and dependencies, thereby more comprehensively understanding the structure and semantics of sequence data.
[0184] CLSTM: The CLSTM model combines convolutional layers with LSTM units. It uses convolutional layers for local feature extraction while retaining the ability of LSTM to process sequence information, thereby achieving a balance between feature extraction and sequence modeling.
[0185] CNN: CNN processes service embeddings through convolution operations to extract local features, thereby providing effective representations for service classification tasks. Convolutional layers can automatically learn local feature patterns in data, making them suitable for processing data with local correlations.
[0186] RCNN: RCNN combines convolutional and recurrent layers, effectively extracting local features from service embeddings while considering the extraction of global features. It captures long-term dependencies in sequential data through recurrent layers, while convolutional layers are responsible for extracting local features, achieving more comprehensive representation.
[0187] ANFM4WSC: This method integrates content and structural semantic information of services and uses attention mechanism to deeply fuse features. It can automatically focus on more important features for classification tasks, thus achieving effective service classification.
[0188] Serve-Net: Serve-Net is a new type of deep neural network that discards traditional feature engineering and length restrictions. This network can automatically abstract low-level representations of service names and descriptions into high-level combined features, better capturing the semantic information of services and providing more effective representations for classification tasks.
[0189] Performance evaluation:
[0190] Table 2 lists the default parameter settings of the model. Subsequent experiments will analyze the impact of main hyperparameters on model performance. In the Web service recommendation and classification tasks, this part verifies the performance difference between M2CL4SRL and baseline methods through comparative experiments. In the recommendation task, since the average number of interactions between Mashup and Web API in the dataset is 1.84, the Top-K range of recommended Web API is set to {2, 4, 6}. In the classification task, Top-K accuracy is evaluated when K = 1 and K = 5. The accuracy when K = 1 directly reflects the recommendation quality, while the accuracy when K = 5 reflects the model's ability to recommend relevant services among multiple candidate services. The default hyperparameter values of M2CL4SRL are shown in Table 2.
[0191] Table 2 Model default parameters
[0192]
[0193] (1) Comparison with the service recommendation baseline method. In the Web service recommendation task, the dot product calculation method is used to measure the similarity between Mashup and Web API embeddings based on the proposed service representation method. Table 3 shows the precision, recall, F1-Score, and normalized discounted cumulative gain (NDCG) of various methods in the Web service recommendation task. The results show that as the value of K increases, the recall of all methods improves, while the precision shows a negative correlation. This is because as the value of K increases, the hit rate improves, but at the same time, more noise is introduced. F1-Score is the weighted average of recall and precision.
[0194] Among all methods, NAFM, RWR, and BPRMF perform relatively poorly. NAFM uses neural decomposition to extract features from service text, but the large amount of noise in the text description negatively affects its performance. RWR extracts features from the knowledge graph through random walk algorithm, but due to the sparsity of service call records, feature extraction is limited, resulting in poor recommendation performance. BPRMF, as a matrix decomposition-based method, performs poorly in handling large-scale data and complex relationships, making it difficult to capture high-order and implicit relationships between services. In contrast, SANFM introduces a self-attention neural network layer, effectively reducing the impact of noise information in the text description, thereby improving performance. LightGCN improves on traditional GCN by learning better user and item representations, enabling more effective capture of complex relationships between services. FSFM performs well by integrating text and structural information and using convolution layers for recommendation. SRCLML combines multi-task learning and contrastive learning, integrating service text and structural views, achieving better performance. However, M2CL4SRL shows significant advantages. It introduces a multi-level contrastive learning mechanism and more comprehensively considers the impact of different interaction frequencies on service representation, thereby more effectively integrating text and structural information and improving model performance. At K = 4, M2CL4SRL outperforms the baseline method SRCLML, with precision, recall, F1-Score, and NDCG increasing by 13.4%, 6.9%, 11.9%, and 5.3%, respectively.
[0195] Table 3 Web service recommendation performance
[0196]
[0197]
[0198] (2) Comparison with the service classification baseline method. In the classification task, the proposed service representation method is used to obtain Mashup and Web API embeddings as input, and a multi-layer perceptron (MLP) classifier is used to complete the service classification task. Tables 4 and 5 show the classification performance of various methods on the Mashup dataset and the Web API dataset, respectively. It is observed that the classification method performs better on the Mashup dataset than on the Web API dataset. This may be because the Mashup dataset is larger in size, and the model can obtain more training samples, thereby obtaining better generalization ability.
[0199] Table 4 Service classification performance on Mashup dataset
[0200]
[0201] Table 5 Service classification performance on Web API dataset
[0202]
[0203]
[0204] Among all methods, CNN performs the worst because it can only extract local features of services and cannot capture global features. In contrast, RCNN significantly improves performance after introducing a sequence model. Similarly, Bi-LSTM and CLSTM also achieve greater improvement compared to LSTM. Serve-Net performs well in Top-1 Acc and precision in the Web API classification task by integrating service descriptions and names into high-order features and using neural networks for further feature extraction. ANFM4WSC considers both the text description and structural information of services and performs service classification through ANFM, which performs relatively well among the baseline methods. M2CL4SRL introduces a multi-level contrastive learning mechanism and more deeply considers the impact of different interaction frequencies on service representation, thereby more effectively integrating text and structural information. On the Mashup dataset, compared with the baseline method, M2CL4SRL improves Top-1 Acc by 18.6%, Top-5 Acc by 3.9%, precision by 2.7%, recall by 2.2%, and F1 score by 29.3%. On the Web API dataset, M2CL4SRL outperforms the baseline method, with Top-5 Acc improved by 0.7%, recall improved by 31.7%, and F1 score improved by 21.1%.
[0205] On the Mashup dataset, M2CL4SRL outperforms the baseline method by 18.6% in Top-1 Acc, 3.9% in Top-5 Acc, 2.7% in precision, 2.2% in recall, and 29.3% in F1 score. On the Web API dataset, M2CL4SRL outperforms the baseline method by 0.7% in Top-5 Acc, 31.7% in recall, and 21.1% in F1 score.
[0206] Ablation experiments:
[0207] To evaluate the contribution of each module part of the proposed model, the present invention performs ablation experiments. The M2CL4SRL model mainly includes text view, structure view, contrastive learning, local contrastive learning, global contrastive learning, and improved contrastive learning loss. Therefore, there are six variants in total, as follows:
[0208] w / o Text removes the text encoding module and the global contrastive learning module. Service representation only depends on the features extracted from the service interaction network view.
[0209] w / o Graph removes the structure encoding module and the global and local contrastive learning modules. Service representation is completely based on the text view features of the service.
[0210] w / o CL removes all contrastive learning modules, only using the text description encoding module and the structure relationship encoding module to represent the Web service.
[0211] w / o Local removes the local contrastive module in multi-level contrastive learning, leaving global contrastive learning.
[0212] w / o Global removes the global contrastive module in multi-level contrastive learning, leaving local contrastive learning.
[0213] w / o CLpro removes the popularity-based contrastive learning and uses the traditional contrastive learning function instead.
[0214] In these variants, the present embodiment analyzes the influence of each component in detail to evaluate its contribution to the overall model performance. Through these ablation experiments, the role and importance of each part can be deeply understood. Figure 5Ablation study results for the Web service recommendation task are shown. From the results, it can be seen that the performance of the "w / o Graph" variant is always the worst, indicating that the service structure encoding module has a significant impact on the overall recommendation performance. Specifically, the performance of the "w / o CL" variant is worse than that of the "w / o Text" variant, indicating that contrastive learning plays a key role in promoting the fusion of service text and structure views. In addition, the performance of "w / o Global" is better than that of "w / o Local", indicating that fine-grained feature learning may be more important in service representation. Finally, M2CL4SRL achieves the best performance, verifying the effectiveness of multi-level contrastive learning and the improved contrastive learning loss function.
[0215] The present embodiment also conducts an ablation experiment on the Mashup and WebAPI dataset for the classification task, and the results are shown in Figure 6 and Figure 7 In the service classification task, the observed conclusions are similar to the Web service recommendation task. In particular, in the recommendation task, the "w / o Graph" variant performs the worst, while in the classification task, the "w / o Text" variant performs the worst. This result indicates that the service relationship structure is more critical for the service recommendation task, while the encoding of the text description is more important for the service classification task.
[0216] Hyperparameter analysis:
[0217] The present embodiment analyzes the influence of various hyperparameters in M2CL4SRL, including the weights of local and global contrastive loss functions (λ1, λ2), local and global temperature coefficients (τ1, τ2), the weight factor in the contrastive loss function in WebAPI representation (α), and the embedding dimension of service representation (d). The purpose is to study the influence of different hyperparameters. All experiments are conducted in the Web service recommendation task, and the Top-K is set to 4. Hyperparameter analysis
[0218] (1) Influence of λ1 and λ2. λ1 controls the weight of the local contrastive loss function. To study its influence on model performance, experiments are conducted in the range of {0.001, 0.005, 0.01, 0.05, 0.1}, and the results are shown in Figure 8 (a). It is observed that as λ1 increases, the model performance first increases and reaches a peak when λ1 is about 0.05. However, when λ1 continues to increase, the performance gradually decreases. Similarly, λ2 controls the weight of the global contrastive loss function. To explore its influence on model performance, experiments are conducted in the range of {0.001, 0.005, 0.01, 0.05, 0.1}, and the results are shown in Figure 8(b) shows. With the increase of λ2, the model performance first rises and reaches the peak when λ2 is about 0.01. After that, with the further increase of λ2, the model performance begins to decline. Based on these observations, it can be concluded that appropriate contrastive loss helps to serve the representation, thereby improving the performance of the recommendation task. However, too strong alignment may cause the model to pay too much attention to the contrastive loss, leading to representation bias and reducing performance.
[0219] (2) The influence of τ1 and τ2. τ1 and τ2 are hyperparameters in local and global contrastive learning, respectively. The temperature parameter plays a key role in contrastive learning by affecting the sample feature distribution to enhance the model's ability to recognize similarity. Lower temperature can reduce the distance between similar samples and increase the distance between dissimilar samples. However, extreme values can destroy the uniformity of the distribution, thereby negatively affecting the learning effect. Experiments explore different values of τ1 and τ2. τ1 is set to {0.001, 0.005, 0.1, 0.2, 0.5}. As shown in Figure 8 (c), when τ1 = 0.2, the model performs best, and further increasing τ1 does not bring significant improvement. τ2 is set to {0.001, 0.005, 0.01, 0.05, 0.1}. As shown in Figure 8 (d), when τ2 is about 0.05, the model performs best. Beyond this value, the performance declines, indicating that a larger τ2 in global contrastive learning hinders the model's ability to distinguish positive and negative samples, thereby affecting the overall representation effect.
[0220] (3) The influence of α. α controls the contrastive learning weight between two kinds of paired samples and . The setting of α is crucial for balancing the feature learning of paired samples. Experiments are conducted in the range of {0, 0.2, 0.4, 0.6, 0.8, 1}, and the results are shown in Figure 8 (e). Observations show that when α = 0.8, the model performs best. This indicates that when α = 0.8, the model has achieved a balance between the WebAPI sample representations in and , emphasizing the importance of learning the features of the same type of paired samples while ensuring that the model effectively captures the differences between different types of paired samples.
[0221] (4) The influence of d. d is the dimension of the service embedding in LightGCN, determining the dimension of the service feature mapping. By setting d in the range of {16, 32, 64, 128, 256}, the influence of different embedding dimensions is studied, and the results are shown in Figure 8(f) is shown. When d = 128, the model achieves the best performance. As d increases, the model performance initially improves but then decreases. Therefore, a larger d value can better capture the complex interactions between neighboring nodes, but an excessively large d value can introduce more noise and cause overfitting.
[0222] The embodiment mainly explores the high-quality representation problem of Web services. At present, although the mainstream methods of Web service representation have their own advantages, they also have disadvantages. The method of service recommendation relying only on text information or structure information cannot fully capture the information available for recommendation, and it is difficult to effectively solve the inconsistency of service text description and the sparsity of interactive data. Therefore, how to fuse multi-view feature information to complete high-quality representation is a difficult problem to be solved. Therefore, the embodiment proposes a Web service representation method based on multi-view multi-level contrast learning (M2CL4SRL). The related work is summarized as follows:
[0223] M2CL4SRL integrates multi-view features and multi-level contrast learning to extract local fine-grained features and global features to achieve more accurate representation. In addition, to solve the problem of uneven popularity distribution in service data, the embodiment designs a novel contrast learning strategy to assign learning weights to different types of WebAPIs, thereby better capturing their functional information. Extensive experiments show that the proposed method outperforms the baseline method in performance. Ablation studies further study the contribution of each module in multi-view representation learning and multi-level contrast learning.
[0224] The above is only the preferred specific embodiment of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A Web service representation method based on multi-view multi-level contrastive learning, characterized in that, The method comprises the following steps: acquiring a programmable Web dataset; based on the programmable Web dataset, acquiring a Mashup text description and a Web API text description; inputting the Mashup text description and the Web API text description into a Sentence-BERT model to acquire a Mashup text representation and a Web API text representation; inputting the programmable Web dataset into a Web service interaction network model to acquire a Mashup structure representation and a Web API structure representation; the Web service interaction network model comprises a Mashup-API interaction network submodel, a Mashup-Tag interaction network submodel and an API-Tag interaction network submodel; the Mashup-API interaction network submodel comprises a Mashup-API network and a LightGCN model; the Mashup-Tag interaction network submodel comprises a Mashup-Tag network and a LightGCN model; the API-Tag interaction network submodel comprises an API-Tag network and a LightGCN model; wherein the LightGCN model is used for performing graph convolution processing on the Mashup-API network, the Mashup-Tag network and the API-Tag network respectively to acquire a structure representation vector; inputting the programmable Web dataset into the Web service interaction network model to acquire the Mashup structure representation and the Web API structure representation comprises: inputting the programmable Web dataset into the Mashup-API interaction network submodel to acquire a first Mashup embedding vector and a first Web API embedding vector; inputting the programmable Web dataset into the Mashup-Tag interaction network submodel to acquire a Mashup Tag embedding vector and a second Mashup embedding vector; inputting the programmable Web dataset into the API-Tag interaction network submodel to acquire a Web API Tag embedding vector and a second Web API embedding vector; dividing the corresponding embedding vectors and assigning different weights for local contrast learning to acquire the Mashup structure representation and the Web API structure representation; respectively performing global contrast learning on the corresponding text representations and structure representations to acquire corresponding global feature information; adding the corresponding global feature information to acquire a Web representation vector.
2. The Web service representation method based on multi-view multi-level contrastive learning according to claim 1, characterized in that, acquiring the Mashup text representation and the Web API text representation comprises: performing dimension reduction processing on the output result of the Sentence-BERT model by using a multi-dimensional perception machine to acquire the Mashup text representation and the Web API text representation.
3. The Web service representation method based on multi-view multi-level contrastive learning according to claim 1, characterized in that, the local contrast learning comprises: performing local contrast learning on the first Mashup embedding vector and the second Mashup embedding vector by using a first local contrast loss function to acquire a Mashup structure representation; The first Web API embedding vector and the second Web API embedding vector are subjected to local contrast learning by using a second local contrast loss function, so as to obtain Web API structure representation; The Mashup Tag embedding vector and the Web API Tag embedding vector are subjected to local contrast learning by using a third local contrast loss function, so as to promote the learning of service features in the interactive network convolution process.
4. The Web service representation method based on multi-view multi-level contrastive learning according to claim 3, characterized in that, The first local contrast loss function is: The second local contrast loss function is: The third local contrast loss function is: in, This represents the local contrastive learning loss value corresponding to the Mashup. This represents the local contrastive learning loss value corresponding to the API. The local contrastive learning loss value corresponding to the Tag table. This refers to a Mashup collection. Indicates the first Mashup This refers to a collection of Web APIs. Indicates the first One API, This represents a collection of tags. Indicates the first One tag, Indicates the first A Mashup in The structural representation vector corresponding to the view. Indicates the first A Mashup in The structural representation vector corresponding to the view. Indicates the first A Web API in The structural representation vector corresponding to the view. Indicates the first A WebAPI in The structural representation vector corresponding to the view. Indicates the first The tag is in The structural representation vector corresponding to the view. Indicates the first The tag is in The structural representation vector corresponding to the view. Used to calculate the similarity between two vectors. For temperature parameters, To control the hyperparameters of the model's attention weights for different samples, For the same set of Web APIs, This is a collection of different categories of Web APIs.
5. The Web service representation method based on multi-view multi-level contrastive learning according to claim 4, characterized in that, The corresponding text representation and structure representation are subjected to global contrast learning respectively, so as to obtain corresponding global feature information, which comprises: The Mashup text representation and the Mashup structure representation are subjected to global contrast learning by using a first global contrast loss function, so as to obtain Mashup global feature information; The Web API text representation and the Web API structure representation are subjected to global contrast learning by using a second global contrast loss function, so as to obtain Web API global feature information.
6. The Web service representation method based on multi-view multi-level contrastive learning according to claim 5, characterized in that, The first global contrast loss function is: The second global contrast loss function is: in, This represents the global contrastive learning loss value corresponding to the Mashup. This represents the global contrastive learning loss value corresponding to the Web API. Indicates the first The text representation vector corresponding to each Mashup Indicates the first The text representation vector corresponding to each API. Indicates the first The structural representation vectors corresponding to each Mashup For the first The structural representation vector corresponding to each API Used to calculate the similarity between two vectors. To compare the temperature coefficient in the learning function, To control the hyperparameters of the model's attention weights for different samples, For the same set of Web APIs, This is a collection of different categories of Web APIs.
Citation Information
Patent Citations
Cloud native API (Application Program Interface) recommendation method integrating data enhancement and comparative learning
CN117009674A
Web API recommendation method based on multi-task deep neural network
CN119760231A