# An Approach to Trustworthy Article Ranking by NLP and Multi-Layered Analysis and Optimization
## 2 Related Work  
### Similarity Comparison  
Handling the user-input questions and needs is a crucial first step in a search engine ranking algorithm. A similarity comparison process is typically used to find the database's most relevant results based on user input [3]. In this research, a scenario is that we will compare the user-input data with the metadata of the article, which includes the title, abstract, and keywords. Determining the best procedure for our similarity comparison is essential to reducing false positives. Word embedding and similarity computation in natural language processing (NLP) are the two basic steps in establishing a comparison procedure [4]. The most common similarity computation methods include the Euclidean distance [5] and cosine similarity [6]. The Euclidean distance (demonstrated in Equation (1)) measures the distance between two vectors using the formula  
\[\mathrm{d}(\mathrm{x},\mathrm{y})=\sqrt{\sum(\mathrm{xi}-\mathrm{yi})^{2}} \tag{1}\]  
where  
x = (x1, x2,..., xn) and y = (y1, y2,..., yn) are the two vectors being compared;  
xi and yi are the individual elements at position i in vectors x and y, respectively.  
Cosine similarity (demonstrated in Equation (2)) measures the cosine of the angle between two vectors: the smaller the angle, the higher the similarity. The cosine similarity is given by  
\[\cos(\theta)=(\mathrm{x}\cdot\mathrm{y})/(||\mathrm{x}||\times||\mathrm{y}||) \tag{2}\]  
where  
x = (x1, x2,..., xn) and y = (y1, y2,..., yn) are the two vectors being compared;  
\(\theta\) is the angle between vectors x and y;  
x \(\cdot\mathrm{y}\) is the dot product: \(\sum(\mathrm{xi}\times\mathrm{yi})\)--the sum of products of corresponding elements;  
xi and yi are the individual elements at position i in vectors x and y, respectively;  
\(|\) |x | | and | | y | | are the magnitudes (Euclidean norms): \(\sqrt{\sum}(\mathrm{xi}^{2})\) and \(\sqrt{\sum}(\mathrm{yi}^{2})\).  
There are also other methods for similarity computation, such as Jaccard and Hamming, but they are more suitable for binary strings and thus not applicable in our situation [7]. We choose to use cosine similarity because it is scale-invariant--it measures the angle between vectors rather than their absolute differences. This characteristic is particularly important when comparing user-input keywords with article abstracts, as different textual features (such as term frequencies, semantic weights, and metadata elements) often exist at vastly different numerical scales. The Euclidean distance would allow featureswith larger numerical ranges to disproportionately influence the similarity calculation, potentially masking important relationships in other dimensions [8]. Although there are many new ways to compare document similarity, such as Fuzzy String matching [9] and Graph-based Methods [10], we keep this part standard to focus on other research areas.  
For the word embedding process, common NLP methods include TF-IDF, Word2 vec, DOC2 vec, and Transformers. TF-IDF (term frequency-inverse document frequency) determines a word's importance based on its frequency in the document relative to its frequency across all documents [11]. Word2 vec, developed by Google, uses neural networks to capture contextual meanings with methods like Continuous Bag of Words and Skip-gram [12]. DOC2 vec extends Word2 vec to document-level embeddings [13]. Transformers represent the state-of-the-art methods such as BERT [14], excelling in embedding long sentences.