# Innovative Application of Blockchain Technology for Digital Recipe Copyright Protection
## 4 Text Similarity Detection
### PageRank Algorithm  
PageRank [25] is an algorithm developed by the founders of Google, [PERSON] and [PERSON], in 1996 that is used to measure the importance of web pages. The main idea of PageRank is that the extent of a web page depends not only on the number of other web pages linking to it but also on the importance of those pages themselves. The algorithm is based on hyperlinks between web pages, where each web page is considered a node, and each link as an edge pointing from one node to another. \[PR(A)=(1-d)+d\bigg{(}\frac{PR(T_{1})}{C(T_{1})}+\ldots+\frac{PR(T_{n})}{C(T_{n}) }\bigg{)} \tag{1}\]  
In this formula [26], \(PR(A)\) is the PageRank value of web page \(A\) that we want to calculate; \(PR(T_{1})\) to \(PR(T_{n})\) are the PageRank values of all web pages linking to web page A; \(C(T_{1})\) to \(C(T_{n})\) is the number of outgoing links of all web pages linking to web page \(A\); and d is the damping factor, which is usually set to 0.85 and represents the probability that a web page will be accessed randomly. When deployed for text similarity detection, the traditional SimHash algorithm exhibits a significant limitation. Primarily, this algorithm calculates the hash value of the text based on the frequency of words within the text. However, this method falls short in accurately reflecting the importance of individual words within the text.For instance, high-frequency words such as \"de\", \"shi\", and \"in\" appear frequently across various texts but contribute minimally to the semantic understanding of the content. Although one can minimize this effect by eliminating generic or \"stop words\", some semantically insignificant words might still persist due to their high frequency.On the contrary, certain low-frequency words, despite their infrequent appearance, may serve as crucial keywords and contribute significantly to the semantics of the text. Hence, if the text's hash value computation relies solely on word frequency, it may overlook these important low-frequency words, leading to imprecise results in text similarity calculation. In the context of blockchain algorithm engineering, these discrepancies can have notable impacts, possibly leading to erroneous conclusions or ineffective solutions. Therefore, refining the approach for better consideration of the semantic importance of words, regardless of their frequency, is a critical aspect of improving the effectiveness and precision of the SimHash algorithm. To more accurately quantify the importance of each word within a text, this study proposes a text hashing calculation method based on the PageRank algorithm. In this approach, we conceptualize the text as a network where each word represents a node and syntactic dependencies between words act as the edges connecting these nodes [27]. Syntactic dependencies delineate the relationships between words within sentences. For example, in the sentence \"the cat is sitting on the mat\", the term \"sitting\" depends on \"cat\" to denote the actor of the action, whereas \"mat\" relies on \"sitting\" to denote the target of the action. We incorporate the concept of the PageRank algorithm into this language dependency network (Figure 4). Within this network, each word is viewed as a node, with the syntactic dependencies serving as the edges connecting these nodes. The damping factor from the PageRank algorithm, typically set at 0.85, is also employed, representing a user's propensity to randomly click on links while browsing web pages. However, given the unique characteristics of natural language text as opposed to web page links, adjustments to the PageRank formula are necessary to suit the demands of natural language processing. We focus on the words that contribute significantly to the sentence's semantics. Therefore, take specific dependencies into consideration, such as ROOT, adj, attr, obj, dobj, iobj,pobj, subj, nsubj, and csubj. These dependencies reflect the crucial roles that words play within sentences, such as subjects, objects, adjectives, and verbs.