# Second-Order Text Matching Algorithm for Agricultural Text
## 5 Experiments
### Performance Comparison Analysis
#### 5.3.2 Efficiency Comparison Analysis  
The purpose of this experiment is similar to the retrieval accuracy comparison analysis experiment described above, and the same test set is used for testing. For each algorithm or model, the total time and the time spent on each query are recorded. The start time of the algorithm or model is denoted as \(t_{1}\). For each query, the time taken to input the query into the algorithm or model is denoted as \(t_{2}\), and the time taken to return the answer is denoted as \(t_{3}\). Finally, the end time of the algorithm or model is recorded as \(t_{4}\). The total retrieval time of each method is obtained by calculating \(t_{4}\)-\(t_{1}\), and the time for each query is obtained by calculating \(t_{3}\)-\(t_{2}\). This results in three lists, each containing 386 data points. Table 3 demonstrates the time required for a method to retrieve a response to a query, as well as the total time for the entire retrieval process. Figure 9 shows the average time and \(C.V\) processed by different algorithms or methods.  
It can be seen that when only BM25 algorithm is used, the algorithm is very fast, taking only 0.02 s per problem on average from the figure. This is due to the fact that BM25 algorithm uses a simple and efficient calculation method. It does not involve complex mathematical operations or matrix calculations. In addition, BM25 algorithm calculates the score for each document independently, which reduces the complexity of the calculation. Matching using only BERT model is very slow, taking an average of 57.22 s per problem, which is unacceptable in real life. BERT model uses a deep bidirectional Transformer structure with a large number of parameters, which allows BERT model to take into  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Method** & **Minimum(s)** & **Maximum(s)** & **Total(s)** \\ \hline SOTM & 0.470 & 2.682 & 779.512 \\ BM25 & 0.001 & 0.044 & 5.879 \\ BERT & 55.376 & 60.864 & 22,086.758 \\ \hline \hline \end{tabular}
\end{table}
Table 3: The time it takes for a method to retrieve an answer to a query and all queries.  
Figure 9: Comparison of average time and C.V of different algorithms or models.  
account more context, but also results in a large amount of computation and memory requirements, which leads to the inefficiency of BERT model. When SOTM algorithm is used, it can be found that the efficiency of SOTM algorithm is also superior. On average, it takes only 2.02 s per problem, which is basically acceptable to us in our daily life. SOTM algorithm first performs word-level matching using BM25 algorithm and selects \(s\) (\(s\) is 10 in this paper) as the candidate set. In this way, the number of queries faced by BERT model when performing text matching is reduced from 386 to 10, which greatly improves the overall efficiency of the algorithm. The higher the number of initial texts, the more significant the improvement.  
It can be found from the figure that the \(C.V\) of BM25 algorithm is the highest, reaching 50.05%. We believe that due to the high efficiency of BM25 in matching, the length of queries plays a significant role in the efficiency of the final algorithm, resulting in significant differences in processing time for each problem. The experiment finds that in the slowest case, it takes about 0.044 s to retrieve a query, while in the fastest case, it takes only 0.001 s to retrieve a query. This is not very different in everyday use, so this paper still uses the mean as the expected time for BM25 algorithm to process a single query. Compared to BM25 algorithm, the \(C.V\) of SOTM algorithm and BERT model is very small, which is 7.18% and 1.12% respectively. This is because the time spent by these two algorithms or models in task matching is much greater than the time required to process queries of different lengths. For most of the different length querys, the time spent by the two algorithms or models is not significantly different.