Skip to main content
. 2024 Mar 6;24(5):1687. doi: 10.3390/s24051687
Algorithm 1: Semantic Information Vector Space Alignment Methods
Cosine similarity vector alignment (outline)
1. Input: text message
2. quantitative:
3.     vA=wA1,wA2,,wAnvB=wB1,wB2,,wBm //vectorization and location information
4. normalization:
5.     uA=vAvAuB=vBvB //vector normalization
6. cosine similarity:
7.     SimilarityuA,uB=uA·uBuA·uB //Text Similarity Determination
8.     SimilarityuA,uB=i=1nwAi·wBii=1nwAi2·i=1mwBi2 //Alignment of text A and text B
9. Determining text similarity: (−1 to 1) The closer to 1 the vectors are, the more similar they are.