# Research Frontiers in the Field of Agricultural Resources and the Environment
## 2 Materials and Methods
### Topic Extraction Method  
The topic clustering model is a statistical model for clustering the implicit semantic structure of text using unsupervised learning, which is widely used in mining the latent semantic relationship and topic information of text. The LDA model is an unsupervised model, which was first proposed by [PERSON] et al. in 2003 [24]. It can automatically extract semantic information from text and explore the underlying semantic associations. This model has the advantage of modeling massive heterogeneous text data and has been widely applied in scientific literature knowledge mining, scientific research hot spot discovery, topic evolution analysis, emerging frontier topic detection, and other research directions. The LDA model considers each dataset as a mixture of a group of potential topics. In the process of text modeling, each document is summarized by using topic probability distribution. In addition, the LDA model is based on the \"word bag\" model, which assumes that the document is a combination of word frequency and does not consider the order relationship between the words in the document, thus simplifying the complexity of the model (Figure 2). Figure 1: The flowchart of the research process. Figure 2: Inference network of the LDA model. Firstly, a document \(d_{i}\) is selected according to the probability \(P(d_{i})\), the topic distribution \(\theta_{m}\) of the document \(d_{i}\) is generated by sampling from \(\alpha\) of the Dirichlet distribution, and the topic \(Z_{m,n}\) of the \(j\)-th word of the document \(d_{i}\) is extracted from \(\theta_{m}\). From the Dirichlet distribution \(\beta\), the word distribution \(\varphi_{k}\) corresponding to the topic \(Z_{m,n}\) is generated by sampling, and finally the word \(w_{m,n}\) is generated by sampling from the word distribution \(\varphi_{k}\). The corpus generation probability of the LDA model is shown in Formula (1), where \(\alpha\) is the prior distribution parameter of the topic distribution \(\theta\); \(\beta\) is the prior distribution parameter of the subject word distribution \(\varphi\); \(w\) and \(z\), respectively, represent the topic generated by the LDA model extraction; the final subject word, \(K\), is the number of topics; and \(M\) is the total number of documents. \[p\bigg{(}\overset{\rightarrow}{w},\overset{\rightarrow}{z}\bigg{|} \overset{\rightarrow}{\alpha},\overset{\rightarrow}{\beta}\bigg{)}=\prod _{k=1}^{K}\frac{\Delta\bigg{(}\overset{\rightarrow}{\varphi_{k}}+\overset{ \rightarrow}{\beta}\bigg{)}}{\Delta\overset{\rightarrow}{\beta}}\prod_{m=1} ^{M}\frac{\Delta\bigg{(}\overset{\rightarrow}{\theta}_{m}+\overset{ \rightarrow}{\alpha}\bigg{)}}{\Delta\overset{\rightarrow}{\alpha}} \tag{1}\]  
In this study, the LDA topic analysis tool is used to cluster and analyze the research topics in the above datasets. Combined with perplexity parameters, the number of research topics is determined. Perplexity is an evaluation index derived from the concept of entropy in information theory, which indicates the degree of certainty of mapping a topic to each word when a topic is given. The smaller the perplexity value, the better the classification effect of the model on new samples. The calculation formula is shown in Formula (2). \[Perplexity(D)=\exp\Bigg{(}-\frac{\sum_{d=1}^{M}\log p(w_{d})}{\sum_{d=1}^{M}N_ {d}}\Bigg{)} \tag{2}\]  
Among them, \(D\) represents the test dataset, \(M\) represents the number of documents, \(w_{d}\) represents the word set that constitutes the document set \(D,p(w_{d})\) refers to the probability of each word appearing in the test dataset, and \(N_{d}\) represents the total number of words appearing in the \(d\)-th document. This article is based on the Gemsim tool in Python, used for the LDA topic analysis. The determination of the number of topics is mainly based on two parameters: the number of topics (K) and the number of iterations (passes). The optimal number of topics is determined by combining the perplexity values and the topic model visualization.