Research Article
A Web Service Clustering Method Based on Semantic Similarity and Multidimensional Scaling Analysis
Algorithm 2
The process of calculating the semantic similarity between two PDs.
| Input: PD1 (the length is m), PD2 (the length is n) | | Output: sim (the semantic similarity between two PDs) | | Begin: | | SUM ⟵ 0; | | FOR i ⟵ 1 to m do: | | MAX ⟵ 0; | | FOR j ⟵ 1 to n do: | | IF WordNet.similarity (Ai, Bj) >MAX do: | | MAX ⟵ WordNet.similarity (Ai, Bj); | | ENDIF | | ENDFOR | | SUM ⟵ SUM + MAX; | | ENDFOR | | FOR j ⟵ 1 to n do: | | MAX ⟵ 0; | | FOR i ⟵ 1 to m do: | | IF WordNet.similarity (Ai, Bj) >MAX do: | | MAX ⟵ WordNet.similarity (Ai, Bj); | | ENDIF | | ENDFOR | | SUM ⟵ SUM + MAX; | | ENDFOR | | sim ⟵ SUM/(m + n); | | RETURN sim; | | END |
|